Rubrik | SDE2 | Feb 2022 | Screening Round Rejected
Anonymous User
6308

Rubrik interviewers focus on concurrency and multithreading. I was asked to prepare for screen round where topic will be on concurrency.

Screening round 1
Expose an interface which will accept a Runnable object along with the waitTime . The implementation should run the Runnable object after waiting time is over.
The condition was that, invocation to the interface should not be blocking. Client will invoke the method, and it should exit immediately.

I was going with some random approach initially and then came up with below approach -

  1. Store the Runnable object in a Heap along with the timestamp when it is going to be triggered (Current timestamp + waitTime)
  2. Create a poller, which will check Heap every 1 second if any eligible Runnable needs to be triggered

I took too much time in this, and time was almost up, and interviewer didn't have much time to ask follow up question.
Follow up question : How to manage large number of threads? If you are planning to use ExecutorService, implement your own service.

I performed very bad in this interview.

Screening round 2
Implement a RateLimiter. Asked to implement canAccept method, and RateLimiter had an initial capacity. Also requests accepted will have an expireTime. After expireTime , RateLimiter can accept new requests.

I went with queue approach. Interviewer asked to implement a single execution first, then asked to implement concurrent scenario. Then follow up question was how to implement shared resources in case of distributed system.

This round went well for me.

Overall, I was rejected.

Comments (5)