The interview problem
Design a system that monitors workshop audio for equipment beeps, compressed-air leaks and unusual impacts. Sounds can overlap. Operators want a small number of useful alerts rather than a notification for every positive audio window. Explain labeling, modeling, event formation, evaluation and deployment to a thousand devices.
Original ML system-design practice, not a reported company interview. This is an advisory maintenance application, not a certified emergency alarm. All operating figures are hypothetical. Primary source retrieved September 27, 2026; interview date not applicable.
1. Define observable events and useful actions
Agree with operators on an event vocabulary and what action each alert supports. An acoustic impact is observable; “machine will fail tomorrow” needs a different outcome label and evidence. Separate normal operating beeps from target warning patterns. Include an unknown category for review without assuming every unrecognized sound is dangerous.
Specify detection latency from event onset, minimum relevant duration, expected noise conditions and a false-alert budget per monitored device-hour. Missing audio is not a negative example. Track coverage gaps and sensor faults separately. Distinguish a model being available from a microphone actually capturing usable audio.
Start with a bounded deployment environment and advisory alerts that an operator can inspect. Different microphones, enclosures, gain settings and room acoustics may change the signal substantially. Decide what audio can be collected and retained with the customer; local inference and short, access-controlled evidence clips may be preferable to continuous central recording.
2. Label overlapping events at the right resolution
Collect representative continuous recordings with authorized handling, including ordinary machinery, speech, music, silence and microphone failures. Annotators mark event class and onset/offset, with an uncertainty convention for ambiguous boundaries. Allow simultaneous classes. A leak and a beep can coexist; forcing one label creates false exclusivity.
AudioSet provides an official vocabulary and annotated sound clips as background for audio-event learning. Presence of a class somewhere in a clip does not locate its exact onset or establish that every other class is absent. Pretraining on general audio can help representation learning, but workshop-specific events and temporal labels still need validation.
Split by recording session and physical environment before creating overlapping windows. Neighboring windows from one recording share signal and should not land on both sides of the train/test split. Hold out device types or sites to measure the actual deployment generalization requirement. Preserve a final prospective period that includes natural class prevalence.
Use deliberately sampled difficult negatives such as normal metal handling for the impact detector, but record the sampling policy. A balanced development set cannot directly estimate the alert burden in a mostly-negative continuous stream. Uncertain or unreviewed regions should be masked where appropriate rather than declared exhaustive negatives.
3. Separate acoustic scoring from event decisions
microphone → signal-quality checks → rolling audio buffer
↓
time-frequency features
↓
multi-label temporal model
↓
per-class scores + timestamps
↓
event state machine and alert policy
↓
operator review → outcome/label feedbackA baseline converts calibrated audio into log-mel features and uses a compact convolutional or temporal model with one sigmoid score per class. Separate sigmoid outputs permit overlapping labels; their scores need not sum to one, and this does not imply that the underlying sound events are statistically independent. Train with a masked multi-label objective and report class-specific results. Label weighting changes optimization emphasis and may require recalibration against natural prevalence.
For the example, use two-second trailing windows every half second. The feature and model versions include sample rate, channel handling, amplitude normalization, transform settings and output class mapping. Keep device timestamps consistent with audio sample positions. A feature mismatch can look like model drift even when the weights are unchanged.
A clip classifier gives a score for a window, not a precise event boundary. For tighter timing, train frame-level outputs or a temporal localization head with suitable labels. A trailing-window model can score at each hop, but reliable onset latency depends on the evidence it needs, smoothing and compute time. Measure it end to end rather than equating window size with guaranteed latency.
4. Turn scores into a defined event stream
Maintain a separate state machine for each class and device. An illustrative policy opens an event after two consecutive half-second hops exceed a high threshold, and closes it after three consecutive hops fall below a lower threshold. The lower closing threshold provides hysteresis. These are tuning choices, not universal settings, and they may miss very short events.
Keep event identity stable as its end time extends. Alert once when the event becomes eligible, update its duration and preserve the evidence window. Define whether a short gap merges two detections; do not let an unbounded cooldown suppress every later event. For equipment-specific alarms, a genuinely new event may require a new notification even if it occurs soon after the last one.
The second qualifying hop adds at least half a second relative to the first qualifying score, excluding processing delay. Three negative hops delay closure relative to the first negative score. Neither delay should be confused with the ground-truth onset/offset error, which also depends on the model's response. Record both inferred boundaries and notification timestamps.
Define reset behavior after dropped audio, process restart or clock discontinuity. A device should not join scores from before and after a long gap into one continuous event. Mark interrupted events explicitly and restart the required evidence sequence. Cloud retries deduplicate by event ID rather than creating a fresh alert for each transmission.
5. Translate window errors into operational burden
At a half-second hop, steady-state inference makes 7,200 decisions per hour. Suppose a target class has a 0.1% false-positive window rate on truly negative monitoring time. Expected positive windows are 7.2 per hour. Multiplying by a thousand devices gives 7,200 positive windows per fleet-hour under the same conditions. Independence is not needed for this expectation when each decision has the stated marginal rate.
This is not 7,200 alerts. Correlated adjacent errors can merge into fewer events; isolated errors may be filtered out. Nor can you square 0.001 to estimate the two-hop trigger probability unless successive false positives are independent. Shared audio and persistent background noise make that assumption implausible in many deployments.
Suppose held-out negative recordings contain 7,200 false-positive windows over 1,000 device-hours, but the complete event policy emits 60 false alerts. Window positives remain 7.2/hour, while operational burden is 0.06 false alerts/device-hour. At a thousand devices for eight hours of comparable negative monitoring each, that projects to 480 false alerts/day if the observed environment mix and rates persist. For mixed positive and negative operation, also measure unmatched alerts per total monitored hour; the two denominators are not interchangeable.
If the agreed budget is 0.01 false alerts/device-hour, the observed policy misses it by sixfold. Tune thresholds, improve data or change the event definition with the customer, then retest on separate data. Do not report the filtered alert rate as the raw model's window false-positive rate. A lower alert rate obtained by suppressing true events is not automatically an improvement.
6. Evaluate events, timing and coverage
Match predicted and labeled events within the same class using a declared one-to-one rule with onset tolerance and, where meaningful, offset overlap. One long prediction must not earn credit for every separate ground-truth event it spans. Report the rule and its sensitivity; an onset-only match can hide a prediction that never closes.
Report per-class event precision and recall, false alerts per negative device-hour, notification latency for detected events and monitored-time coverage. Include missed events separately from latency: excluding misses can make an unreliable model look fast. Also report performance by site, device, noise level and overlapping-event combinations.
For 200 labeled target events, suppose 160 receive a valid match and there are 40 unmatched predictions. Recall is 160/200=80%; precision is 160/(160+40)=80% under that matching policy. These numbers do not determine false alerts/hour without exposure duration, and they do not prove performance for a rare critical subclass.
Use representative continuous recordings to select a feasible operating point. A high area under a ranking curve may still fail the customer's required low-alert region. Quantify uncertainty across sites or recording sessions rather than treating thousands of adjacent windows as independent samples. When testing many thresholds, retain an untouched final evaluation set.
7. Size deployment and preserve observability
At 16 kHz, mono, sixteen-bit uncompressed audio, a device generates 32,000 bytes/s. A thousand devices generate 32 MB/s, or 2.7648 TB/day with continuous recording in decimal units. A ten-second local ring buffer needs 320 KB/device before processing overhead. These figures motivate data minimization but do not include compression, metadata or replication.
If inference takes twenty milliseconds per hop on the target device, two invocations per second consume forty milliseconds of compute time per second, roughly 4% of one continuously available execution resource under a serial assumption. Measure real CPU, accelerator, thermal and battery behavior; model runtime is not the complete application's utilization.
Deploy a signed/versioned model bundle with compatible features and thresholds. Shadow a new version before changing notifications, with the same event-policy definitions. Monitor audio clipping, sample loss, input levels, score distribution, event counts and operator corrections. A sudden absence of alerts can indicate a broken microphone rather than perfect performance.
8. Analyze failures and trade-offs
Replayed training sounds can improve a test score without representing real acoustics. Repeated recordings across splits, label leakage from filenames and aggressive normalization that erases useful level information are additional failure modes. Test genuine background variation and overlapping sources, not only isolated clean examples mixed at convenient levels.
Longer context can distinguish patterns but increases memory and may delay decisions. Stronger smoothing reduces nuisance alerts while merging or missing short events. Edge inference reduces continuous transfer but complicates fleet updates. Cloud inference centralizes operations while requiring network availability and an explicit audio-handling policy.
Follow-ups: How would you detect a short impulse? What if device gain changes automatically? How would you evaluate a new site with few labels? Can a parent class and child class both be emitted? What happens when an event persists for hours? How would you distinguish a sensor fault from quiet operation?
9. Self-review rubric
- Define observable classes, timing and the customer's alert budget.
- Allow overlaps and distinguish clip presence from temporal labels.
- Split recordings before window generation.
- Specify event formation, merging, reset and deduplication behavior.
- Separate window errors from alerts per monitored hour.
- Evaluate one-to-one event matches, misses, latency and domain slices.
- Calculate compute and audio volume with stated units and monitor sensor health.
Sources and related practice
Google Research: AudioSet, dataset described in ICASSP 2017; retrieved September 27, 2026. Primary background for sound-event vocabulary and clip annotations. The workshop prompt, event protocol and calculations are original practice, not AudioSet benchmark claims.
Continue with speaker diarization and precision-recall curves.
Continue your preparation
Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.