cs-097 — The Canteen Queue Log
| Field | Value |
|---|---|
| id | cs-097 |
| difficulty | Beginner |
| topics | data, aggregation |
| lecture | lecture-25 |
| estimated time | 5-minute attempt + 10-minute discussion |
| prerequisites | none |
| objective | state inputs, outputs, and assumptions, then solve a small instance by hand |
| solution | held by the instructor; discussed after the attempt |
Problem
From a queue-length log, answer: busiest hour, average wait proxy, quietest day. Framing questions before computing.
Your deliverable is the stated assumptions, the service rule made precise (numerator, denominator, unit), and one cohort split that changes the story. If the problem is ambiguous anywhere, state the assumption you are making and carry on — a stated assumption is part of a good answer.
Examples
- Input: queue lengths by hour: 11:00->8, 12:00->22, 13:00->25, 14:00->6; week total 950 served
- Output: busiest hour 13:00; 'average wait proxy' must be defined (e.g. queue/time) before computing; quietest day stated
Solve for the worked instance first. Then ask what would change if one number, name, or condition were replaced by something stranger.
What to notice
- Write the three questions first, then the exact definition of each measure - the computing is trivial afterwards.
- Writing the rules IS the solution; code is transcription.
- Every assumption is a place where two good answers can differ.
Discussion starter
After the solution is revealed, the class spends five minutes on this prompt: "Propose one extra rule that would change the verdict — is it an improvement?"
Constraints and assumptions
- Difficulty: Beginner (no prior experience assumed).
- Topics: data, aggregation.
- Classroom-scale inputs unless the problem says otherwise.
- Time-box: about five minutes for a first attempt; partial answers with clear reasoning are worth more than silent struggling.
- Optional stretch (not required): describe an alternative approach and say when it beats the obvious one.
Hints and extension
- First nudge: identify the pattern the worked instance uses before computing anything.
- If stuck after three minutes, write the input/output line you expect and trace the smallest example by hand.
- After the reveal, attempt the extension below before the next lecture.
- Extension challenge: Find the aggregation that answers a different stakeholder's question.