Design an hourly call-agent scheduler
Problem
You are tasked with designing an hourly call-agent scheduler for a single day in Pacific Time (PT). The goal is to determine the total number of agents needed each hour and the number of agents required per customer each hour, based on customer call requirements.
Each customer has a specific number of outbound calls they must make within a defined time window during the day. You have the flexibility to decide when within this window to schedule the calls to minimize the overall staffing needs.
Assumptions:
- An agent can handle at most one call concurrently.
- Each call for a customer takes its specified average handle time (AHT) in minutes.
- Calls can commence at any point within their allowed time window.
- The scheduling strategy can distribute calls across the window to optimize for minimal staffing.
Input Data Schema (CSV):
Each row represents a customer's requirements:
customer_id(string): Unique identifier for the customer.calls_required(int): Total number of calls the customer must make.avg_handle_time_min(float): Average duration of a single call in minutes.window_start(HH:MM, 24-hour, PT): The earliest time a call can start.window_end(HH:MM, 24-hour, PT): The latest time a call can end. (Clarify handling of end times earlier than start times).max_concurrent_calls(int, optional): If provided, limits the number of simultaneous calls for this customer.
Output Requirements:
Produce an hour-by-hour report for the entire day (00:00–23:00 PT). For each hour, the output should include:
hour_start(e.g.,09:00)agents_total: Total agents required across all customers for that hour.agents_by_customer: A mapping ofcustomer_idto the number of agents needed for that specific customer during that hour.
A Command Line Interface (CLI) demo is mandatory. A simple User Interface (UI) is optional and can be considered a bonus.
Constraints and Expectations:
- The solution should have a reasonable runtime for up to approximately 10,000 customers.
- Clearly document all assumptions made, including any rounding rules for converting partial-hour workloads into integer agent counts.
- The primary objective is to minimize peak agent utilization. Alternative objectives may be proposed and justified.
Similar LeetCode problem: Task Scheduler
AI interview prep
Core dilemma
Balancing the discrete nature of agent assignments (integer agents) with the continuous nature of call durations and scheduling windows to minimize peak resource utilization.
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Design an hourly call-agent scheduler
Problem
You are tasked with designing an hourly call-agent scheduler for a single day in Pacific Time (PT). The goal is to determine the total number of agents needed each hour and the number of agents required per customer each hour, based on customer call requirements.
Each customer has a specific number of outbound calls they must make within a defined time window during the day. You have the flexibility to decide when within this window to schedule the calls to minimize the overall staffing needs.
Assumptions:
- An agent can handle at most one call concurrently.
- Each call for a customer takes its specified average handle time (AHT) in minutes.
- Calls can commence at any point within their allowed time window.
- The scheduling strategy can distribute calls across the window to optimize for minimal staffing.
Input Data Schema (CSV):
Each row represents a customer's requirements:
customer_id(string): Unique identifier for the customer.calls_required(int): Total number of calls the customer must make.avg_handle_time_min(float): Average duration of a single call in minutes.window_start(HH:MM, 24-hour, PT): The earliest time a call can start.window_end(HH:MM, 24-hour, PT): The latest time a call can end. (Clarify handling of end times earlier than start times).max_concurrent_calls(int, optional): If provided, limits the number of simultaneous calls for this customer.
Output Requirements:
Produce an hour-by-hour report for the entire day (00:00–23:00 PT). For each hour, the output should include:
hour_start(e.g.,09:00)agents_total: Total agents required across all customers for that hour.agents_by_customer: A mapping ofcustomer_idto the number of agents needed for that specific customer during that hour.
A Command Line Interface (CLI) demo is mandatory. A simple User Interface (UI) is optional and can be considered a bonus.
Constraints and Expectations:
- The solution should have a reasonable runtime for up to approximately 10,000 customers.
- Clearly document all assumptions made, including any rounding rules for converting partial-hour workloads into integer agent counts.
- The primary objective is to minimize peak agent utilization. Alternative objectives may be proposed and justified.
Similar LeetCode problem: Task Scheduler