Uber Goldman Sachs Rubrik LLD Interview Design Scheduled Executor Service
Question Details
Question: Design a custom
ScheduledThreadPoolExecutor or
ScheduledExecutorService from scratch – a classic concurrency problem asked by Uber, GS, and Rubrik to test senior engineering skil
Full Details
Question: Design a custom
ScheduledThreadPoolExecutor or
ScheduledExecutorService from scratch – a classic concurrency problem asked by Uber, GS, and Rubrik to test senior engineering skills. ---
Key Concepts: Thread pool with worker threads DelayQueue to hold tasks ordered by next execution time Delayed interface for time‑based ordering Scheduling strategies: - schedule after initial delay - schedule at fixed‑rate - schedule at fixed‑delay Thread safety and rescheduling logic ---
Solution Overview: 1. Use a DelayQueue to store ScheduledTask objects (implements Runnable + Delayed). 2. Worker threads loop, calling take() – this blocks until a task’s delay expires. 3. Once executed, if the task is periodic, update its next trigger time and put it back into the queue. 4. For fixed‑rate, next trigger = previous trigger + period; 5. for fixed‑delay, next trigger = current time + delay. 6. Shutdown interrupts workers and clears the queue. --- I actually created a deep dive tutorial breaking down the entire process, including the thread factory setup and the nanosecond-precision rescheduling. Check it out here: LINKED IN: linkedin.com/in/code-granular-43288739a/ YT : CodeGranular -> Low Level
System Design Concurrency Edition #Java #Concurrency #SystemDesign #Multithreading #InterviewPrep #Scheduler #ScheduledThreadPoolExecutor #ScheduledExecutorService #DeplayQueue #LLD
About This Question
This is a reported interview question from a uber interview for a swe role during the system design round reported in 2026.
It covers the following topics: Os, Concurrency, System Design, Oop, Queue, Stack .