Thread Pools & Schedulers
After the dependency scheduler, executors are among the most common of Rubrik's concurrency prompts. You get work to run later, or a set of workers to keep busy, and the built-ins are off the table. With no ExecutorService and no BlockingQueue, you build the piece from a lock and a condition variable, and it has to compile and run on CoderPad.
Three of them come up most, and two newer, rarer prompts round out the set. Each keeps a small piece of shared state, and the work is keeping it right as tasks start and finish.
The code runner on this page can't catch a race, so each problem turns the threads into calls you make in order: submit a task, start it, finish it, move the clock. A thread that would block comes back as false or takes a place in a line. Get that single-threaded model passing first, then add locks. The follow-up under each problem puts the lock and the condition variable back in.
RubrikPremium lesson · Coding round
The 5 Rubrik problems are below.
- A Premium questionCoding · Medium · Signature problem
- A Premium questionCoding · Medium · Signature problem
- A Premium questionCoding · Medium · Frequently asked
+ 2 more in this lesson
Each with hints, the follow-up and a tested solution.
Get the Rubrik questions$49 a year · all 100 companies · cancel anytime
From 202 Rubrik reports, forum threads behind logins and write-ups in Chinese.
Rubrik interview guideKnow what Rubrik asks before you walk in.
32 coding · 3 system design · 15 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.