Arcesium Interview Question

Explain Deadlocks and their avoidance.Also asked to write banker's alogirithm program.