AlgoMaster Logo

Design a Task Scheduler

Last Updated: February 7, 2026

Ashish

Ashish Pratap Singh

hard

In this chapter, we will explore the low-level design of a Task Scheduler.

There are multiple variants to this problem which you can find in the concurrency interview course:

Let’s start by clarifying the requirements:

1. Clarifying Requirements

Before starting the design, it's important to ask thoughtful questions to uncover hidden assumptions and better define the scope of the system.

Here is an example of how a conversation between the candidate and the interviewer might unfold:

After gathering the details, we can summarize the key system requirements.

1.1 Functional Requirements

  • The system should schedule one-time tasks to run at a specific future time
  • The system should schedule recurring tasks to run repeatedly at a fixed interval
  • The system should execute tasks concurrently using a configurable number of worker threads
  • The system should allow cancelling a scheduled task before it executes
  • The system should notify observers when tasks start, complete, or fail
  • The system should track task status through its lifecycle

1.2 Non-Functional Requirements

  • The design should follow object-oriented principles with clear separation of concerns
  • The system should be thread-safe for concurrent scheduling and execution
  • The system should be extensible to support new scheduling strategies without modifying existing code
  • The components should be testable in isolation

2. Core Entities and Classes

Premium Content

This content is for premium members only.