LinkedIn Interview Question

Write put/get methods for a BlockingQueue

Interview Answer

Anonymous

Apr 13, 2012

In Java, just make the methods synchronized.When one thread is executing a synchronized method for an object, all other threads that invoke synchronized methods for the same object block (suspend execution) until the first thread is done with the object. }