Ocado Group Interview Question

How do you get memory leaks on C language? Can you get memory leaks in Java?