Java Multithreading (Hard) Question. Any idea?
Anonymous User
3975

I was recently asked a question related to multithreading in java by Morgan Stanley,
Q. Imaging you have a List of ids(Integer). Now, a thread is adding new ids in the background and your task is to find if a given id exists or not in the list, taking into account the thread that is regularly adding new values (return true or false).
Given - The ids are added in increasing order only (not continuous), you can't put a lock on the List.

Comments (9)