FrontendInterviews.dev

Loading problem…

68. Progress Bar V - Priority Scheduler

Hard•
Acceptance: 37.00%
•
🔓3/3 Pro unlocks today

This problem builds on progress-bar-iv. Complete that first, then load your solution to continue.

Build on Progress Bar IV.

Add priority scheduling with variable durations:

  • each new bar gets speed: fast (1000ms), medium (2000ms), slow (3000ms),
  • max 3 running at once,
  • when a slot opens choose next by priority fast > medium > slow,
  • if same speed, keep FIFO order.

Constraints

  • Priority ordering: fast, then medium, then slow
  • FIFO tie-breaker within same speed
  • Display speed label for each bar
  • Support Add and Reset actions