Design a service that identifies a recorded song from a short, noisy audio sample. Connect requirements and APIs to data modeling, consistency, scaling, failure recovery, observability, and the important design trade-offs.
Design a service that identifies a recorded song from a short, noisy audio sample.
The system stores a catalog of reference tracks. A client uploads or streams a brief clip, and the service returns the best matching track with a confidence score or reports no reliable match. Discuss reference preprocessing, fingerprint indexing, query matching, and horizontal scaling.
### Constraints & Assumptions
- Clips may start at any offset and may include background noise or compression artifacts.
- The same recording should match despite moderate volume changes.
- False positive and no-match behavior must be measurable and tunable.
### Clarifying Questions to Ask
- How long are typical clips and how quickly is a result required?
- Is the catalog batch-loaded or updated continuously?
- Do we identify the exact recording or merely the underlying composition?
```hint Preserve relative time
Individual spectral landmarks are common; pairs of landmarks plus their time difference are much more selective.
```
### What a Strong Answer Covers
- Robust audio fingerprint extraction and an inverted index over fingerprint keys.
- Candidate generation followed by alignment voting on a consistent time offset.
- Confidence thresholds, no-match results, catalog updates, partitioning, and observability.
### Follow-up Questions
- How would you remove a track without rebuilding the full index?
- What causes false positives, and how would you select a threshold?
- How would live microphone streaming change the API?
Quick Answer: Design a service that identifies a recorded song from a short, noisy audio sample. Connect requirements and APIs to data modeling, consistency, scaling, failure recovery, observability, and the important design trade-offs.
Design a service that identifies a recorded song from a short, noisy audio sample.
The system stores a catalog of reference tracks. A client uploads or streams a brief clip, and the service returns the best matching track with a confidence score or reports no reliable match. Discuss reference preprocessing, fingerprint indexing, query matching, and horizontal scaling.
Constraints & Assumptions
Clips may start at any offset and may include background noise or compression artifacts.
The same recording should match despite moderate volume changes.
False positive and no-match behavior must be measurable and tunable.
Clarifying Questions to Ask Guidance
How long are typical clips and how quickly is a result required?
Is the catalog batch-loaded or updated continuously?
Do we identify the exact recording or merely the underlying composition?
What a Strong Answer Covers Guidance
Robust audio fingerprint extraction and an inverted index over fingerprint keys.
Candidate generation followed by alignment voting on a consistent time offset.
Confidence thresholds, no-match results, catalog updates, partitioning, and observability.
Follow-up Questions Guidance
How would you remove a track without rebuilding the full index?
What causes false positives, and how would you select a threshold?
How would live microphone streaming change the API?