Domanda di colloquio di Amazon

How does malloc work in C? How does deadlock prevention work in operating systems?