Ocado Group interview question

Multithreading: What is a deadlock? How do you avoid synchronisation problems among threads? How do you avoid deadlocks?