(Live Pair-Programming Exercise – 90 minutes)
Beacon receives Home Sleep Test (HST) uploads throughout the day. Each uploaded study must be scored by a sleep technician. Some studies also require a double-scoring review by a second technician after the initial scoring is complete.
Your task is to implement a dispatch system that:
- Assigns work to technicians incrementally as capacity becomes available
- Monitors and predicts SLA risk over time
This exercise is a live pair-programming interview focused on general programming ability, .NET/C# fluency, and collaboration.
You will receive this prompt one day before the interview so you can familiarize yourself with the problem and prepare your development environment. No advance coding or solution preparation is expected or required.
Please ensure you have:
- A working .NET development environment (e.g., Visual Studio, VS Code)
- A recent .NET SDK installed
No other preparation is necessary. Please be prepared to share your screen during the interview as you work through the problem.
At the start of the interview, we will provide a project skeleton (basic solution structure, empty classes, and/or a simple runner). You are welcome to use the provided skeleton as-is, modify it, or ignore it and structure the solution differently, if you prefer.
This is not a speed test, and it’s not required that you complete the entire exercise within the allotted time. We are much more interested in the quality and clarity of your code, how you reason about the problem and make tradeoffs, how you communicate and collaborate while pairing, and whether the system you’re building is understandable, correct, and deterministic. You do not need to build a perfect or fully optimized system – a partial solution that is clean, well-structured, and thoughtfully discussed is far preferable to a rushed or brittle “complete” solution, and a clear approach that makes steady progress—and explains what you would do next—is ideal.
- 10 min: clarify rules + outline approach
- 55–60 min: implement dispatch simulation
- 15 min: SLA monitoring + final report
- 5–10 min: cleanup and discussion
All times in this exercise are relative:
- Time is measured in minutes
- Time advances in 30-minute ticks
- Negative values indicate events that occurred before
now - The simulation horizon is 1440 minutes (24 hours)
Example:
uploadedAtMinute = -60→ uploaded one hour agoslaMinutes = 240→ SLA deadline is 4 hours after uploaddeadlineMinute = uploadedAtMinute + slaMinutes
Implement a dispatch simulation that:
- Repeatedly/incrementally assigns eligible work to available technicians based on what work and capacity are available at that moment
- Advances time in 30-minute increments
- Generates review work for studies requiring double scoring
- Produces a report predicting SLA outcomes
Each study has:
studyId(string)customerId(string)uploadedAtMinute(int)slaMinutes(int? — nullable)priorityFlag(bool)requiresDoubleScoring(bool)
Each study generates:
- One Primary work item
- One Review work item only if
requiresDoubleScoring = true
Represent work items explicitly:
workItemId(string)studyId(string)type(PrimaryorReview)readyAtMinute(int)deadlineMinute(int? — inherited from study SLA)
Rules:
- Primary work items have
readyAtMinute = max(uploadedAtMinute, 0) - Review work items are created only after primary completes
- Review work items inherit the same SLA deadline
Technician
Each technician has:
techId(string)availabilityBlocks: list ofstartMinute(inclusive)
endMinute(exclusive)
A technician is available for a tick starting at minute t if:
startMinute <= t && t + 30 <= endMinute
Each technician can work on at most one work item per tick.
Simulate dispatch as follows:
- Start at
t = 0 - Repeat until
t >= 1440or no further work can be completed:- Identify technicians available for tick
[t, t + 30) - Identify eligible work items (
readyAtMinute <= tand not completed) - Assign work items to technicians using the priority rules below
- Mark assigned work items as completed at
t + 30 - For completed primaries that require double scoring:
- Create a Review work item with
readyAtMinute = t + 30 - Must be assigned to a different technician
- Create a Review work item with
- Advance
t = t + 30
- Identify technicians available for tick
When selecting which work item to assign next, order eligible items by:
- SLA urgency
- Items with deadlines come before items without deadlines
- Earlier
deadlineMinutefirst
- Review urgency
ReviewbeforePrimary
- Priority customers
priorityFlag = truebeforefalse
- Age
- Earlier
uploadedAtMinutefirst
- Earlier
- Tie-breaker
studyIdorworkItemIdascending
Choose a deterministic strategy, such as:
- Lowest
techId - Round-robin by
techId
A study is considered complete when:
- Primary is completed, and
- Review is completed (if required)
At the start of each tick (before dispatching work), compute and output an SLA risk snapshot for all SLA-bound studies that are not yet complete. You can use an optimistic earliest-possible completion estimate to classify each study as:
- OnTrack
earliestCompletionMinute <= deadlineMinute - AtRisk
deadlineMinute - earliestCompletionMinute <= thresholdMinutes - WillMiss
earliestCompletionMinute > deadlineMinute
Choose a deterministic thresholdMinutes value (e.g. 60) and document it.
For each tick t, output:
t- Count of SLA studies:
OnTrack / AtRisk / WillMiss - (Optional) List of the most urgent
AtRisk / WillMissstudyIds
After the simulation completes, produce a final SLA report using actual simulated completion times, including:
studyIddeadlineMinuteprojectedCompletionMinute(or null)- Final
slaStatus
Also output a customer-level summary:
customerId- Counts of
OnTrack / AtRisk / WillMiss
- Dispatch log
- Tick minute
techIdstudyId- work type (
Primary/Review)
- Per-tick SLA risk snapshots
- Final SLA report + customer summary
Printed output is sufficient; no UI required.