Ocado Group interview question

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