The scenario
Repair a delivery earnings preview, split peak-rate intervals, and validate order transitions. This original practice follows a DoorDash report that explicitly describes using AI for Dasher Pay.
A failure to reason about
Two simultaneous deliveries each earn pay. A short peak window doubles only its overlap with those deliveries.
Illustrative context for the topic. The exercise’s full requirements arrive in the workspace.
Questions to bring to your review
- Which orders were active during the elapsed interval?
- Where must the timeline split?
- Can a closed order ID be reused?
- Does a rejected event still advance time?
Skills you will practice
- Interval accounting
- Merge of sorted streams
- State invariants
- Boundary testing
Read the existing code, reproduce the reported behavior, review proposed changes, and verify your final implementation. You can use AI assistance while staying responsible for the result.
Prepare with a worked example
- How to review AI-generated code in an interview
Work through a flawed AI patch, design a regression that exposes it, and explain a repair with evidence. A practical code-review exercise for AI-assisted interviews.
See how nrml evaluates an attempt, including the limits of automated evidence.