Elastic interview question

When does a deadlock occur?

Interview Answers

Anonymous

21 July 2017

When the locks are accessed in wrong order. Basically one thread picks lock A first and lock B after, while at the same time another thread picks lock B first and lock A after. This can be solved by comparing the participating objects system hashcodes and re-ordering the locks accordingly.

Anonymous

21 Jan 2019

When a thread that has acquired an lock on a particular resources for its task execution and at the same time when an another thread wants to access the same resources for its task execution then at that situation deadlock occurs.

Anonymous

16 Oct 2019

This looks so good: bit.ly/faang100