Search
⌘K
Get Premium
Leetcode 1834. Single-Threaded CPU
Given tasks with enqueue and processing times, return the order a single-threaded CPU will process them when it always picks the available task with the smallest processing time (tie-broken by original index). This is typically solved by sorting tasks by enqueue time and using a min-heap to manage available tasks and advance time when the CPU is idle.
Asked at:
Doordash
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early October, 2025
Doordash
Mid-level
Mid June, 2025
Doordash
Senior
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.