Rubrik | Phone | Task scheduler

Anonymous User
3097
Apr 12, 2022
Apr 13, 2022

Date: 31st March 2022
Round: 1st interview round
Implement two methods in a class, schedule() and waitUntilComplete().
schedule() should enqueue work to be performed and should be non-blocking.
waitUntilComplete() should block the call untill all scheduled work is completed.

Builtin thread safe constructs like Deque, BlockingQueue, etc. can't be used. Implement it using locks, etc ensuring thread safety.

Comments (6)