The interview problem
A business software platform has ten million organization records from CRM imports, support tools and billing systems. Names, addresses and domains are inconsistent; no universal identifier exists. Design a service that proposes which records describe the same organization, supports daily updates and can undo mistaken merges without destroying source data.
Original ML-design practice, not a reported company interview. All records, scores, costs and workload numbers below are hypothetical. Primary technical references retrieved September 27, 2026.
1. Define what “same organization” means
Choose a legal or operational organization unit before labeling examples. A parent company, its subsidiary and a branch may share a website and address while remaining distinct customer accounts. For this exercise, resolve records to the same customer organization unit; retain parent–subsidiary relationships separately.
Operate within an explicitly authorized tenant or data-sharing boundary. A suggested match must not grant access to another record or account. Billing ownership and authentication remain source-system responsibilities; do not let a similarity model change account access.
Optimize for avoiding incorrect automatic merges, with a review band for ambiguous cases and an unresolved state. Measure missed duplicates too, but do not force every record into an existing entity. Agree which authoritative identifiers are reliable, their namespace and validity period, and how corrections or reassignment are represented.
2. Preserve observations and version decisions
Use source connectors, an immutable observation store, normalization jobs, candidate indexes, a pair scorer, a constrained clustering service and a review console. Publish a versioned mapping from source record IDs to entity IDs; keep raw values, source timestamps and provenance alongside normalized features.
A decision record includes compared source versions, candidate-generation version, model version, features or explanation, score, policy threshold and any reviewer action. A new model or corrected source value creates a new decision version rather than overwriting the evidence behind a historical mapping.
Separate canonical display fields from entity membership. Choosing the latest address for display does not prove that two companies are identical. Publish mapping changes through a replayable event stream with idempotent consumers and an explicit mapping version. Downstream joins should record which version they used.
3. Bound candidate generation without hiding recall loss
Comparing every pair of ten million records requires 10,000,000 × 9,999,999 / 2 = 49,999,995,000,000 comparisons, roughly fifty trillion. Instead, generate candidates through several routes: compatible normalized domains, name plus locality, authoritative identifier matches and a bounded approximate-name index.
For a toy partition into 100,000 disjoint buckets of exactly 100 records, each bucket contributes 100 × 99 / 2 = 4,950 pairs, for 495 million pairs in total. That is roughly a 101,010-fold reduction from all pairs. Real blocks overlap and have unequal sizes; deduplicate pair IDs across routes before scoring.
A single common block containing 100,000 records alone creates 4,999,950,000 pairs. Exclude placeholder domains and missing values from exact-match keys, split oversized blocks using additional evidence, and route uncertain oversized cases to bounded retrieval. Record truncated candidates and measure the recall cost; silent caps can erase entire populations of duplicates.
For daily updates, query indexes for changed records and re-evaluate affected memberships. Also periodically audit records that produced no candidates. A perfect scorer cannot recover a true match that candidate generation never presents.
4. Learn pair evidence, then calibrate for deployment
Begin with explicit identifier rules and a small interpretable model over name similarity, address agreement, domain rarity, source reliability, missingness and temporal compatibility. Compare with a more flexible classifier only when labeled evidence justifies it. Shared words such as “services” or a common coworking address carry less evidence than a rare, verified identifier.
Collect positive matches and difficult negatives from overlapping blocks, then include representative production samples. Split evaluation by real organization and time so alternate versions of the same company do not appear on both sides. Manual labels need a written organization-unit definition and adjudication for parent/subsidiary disagreements.
Do not interpret a classifier score as a probability until calibration is assessed on the relevant candidate population. A model trained on balanced positive/negative pairs can be badly miscalibrated when deployed on mostly nonmatches. Candidate-generator changes also change that population.
As a hypothetical pairwise decision model, let a false merge cost 100 units and a missed link cost one. At match probability p, merging has expected loss 100(1 − p), while leaving separate has loss p. Merging wins only when p exceeds 100 / 101 ≈ 99.01%. These invented costs illustrate a decision rule; they do not establish a universal threshold or account for cluster-wide harm.
5. Do not confuse pair thresholds with coherent entities
Suppose the scorer assigns A–B = 0.998, B–C = 0.997 and A–C = 0.15. At a 0.995 edge threshold, connected components puts all three records together despite the weak A–C evidence. These are model outputs, not guaranteed mutually consistent probabilities of an equivalence relation.
Here A and C may be separate subsidiaries sharing a parent contact in B. Keep high-confidence incompatible identifiers as constraints, inspect bridge edges and avoid automatic union when the proposed cluster violates the organization-unit definition. A missing A–C edge because it was never scored is different from an observed low score.
Consider conservative cluster admission: score relevant cross-cluster pairs or compare verified representative evidence, check hard incompatibilities and send suspicious bridges to review. Requiring every pair to score highly can split valid large entities with sparse evidence, so explain that recall/precision trade-off and reserve an unresolved state.
If a mistaken bridge joins two correct clusters of sizes 20 and 30, it introduces 20 × 30 = 600 false cross-cluster pair relationships. One bad accepted edge can therefore cause much more damage than its edge-level error count suggests. Evaluate resulting clusters and downstream effects, not only accepted-edge precision.
6. Budget scoring and review work
Suppose the deduplicated candidate set contains 600 million pairs. At an assumed sustained 20,000 pair scores per worker-second, a full pass takes 30,000 worker-seconds, or 8.33 worker-hours. Forty workers would take 750 seconds, or 12.5 minutes, under ideal parallelism. Benchmark the actual model; feature joins, storage reads, skew and orchestration are additional costs.
At 100 bytes per stored pair result, 600 million results occupy 60 GB before indexes, replication and explanations. Retaining every intermediate version multiplies that footprint. Keep enough evidence for reproducibility while assigning a retention policy to redundant artifacts.
If 0.1% of candidates enter a human-review band, that is 600,000 pair tasks. At one minute each, review would need 10,000 hours. A review queue is not a free escape hatch. Prioritize high-impact bridges, deduplicate related cluster decisions, sample for model improvement and leave the remainder unresolved rather than auto-approving a backlog.
7. Evaluate the pipeline and make reversals real
Report candidate recall on an independently assembled set of known matches, pair precision/recall on appropriate samples, calibration by source and cluster-level overmerge/undermerge measures. Labels drawn only from generated candidates cannot establish blocking recall. Build a separate audit through authoritative crosswalks where available and expanded manual searches on sampled records; document coverage limits, since convenient known matches may overrepresent easy cases. Track common names, sparse records, recent moves and parent/subsidiary cases separately.
To reverse a merge, create a new mapping version and rebuild the affected component with the rejected relationship prohibited. Removing one edge is insufficient if another path still connects the records. When review establishes that two records must be separate, enforce that cannot-link constraint across the entire rebuilt component, rather than merely banning their direct edge. If available evidence cannot determine the correct partition, quarantine the ambiguous component for review. Preserve entity-ID history, emit split/remap events and reconcile downstream materializations. Undoing a mapping does not automatically retract emails, invoices or other actions already performed.
On corrupted imports or sudden cluster growth, freeze automatic publication for affected sources, retain the last reviewed mapping and route new records to unresolved status. Shadow-test model updates on a fixed evaluation set and inspect large changes before broad release. Concurrency control must prevent a reviewer approving source versions that changed during review.
8. Follow-ups and self-review
Follow-ups: How would you find matches missed by all blocks? Why can one bridge create hundreds of false relationships? What if a domain is reassigned? How do you reverse a merge after consumers have acted? Which constraints distinguish a subsidiary from a duplicate customer record?
Score 0–2 each for identity semantics, candidate recall and skew, calibrated evidence, cluster consistency, and reversible operations. Strong answers make uncertainty visible and never use matching as an authorization mechanism.
Sources and next steps
- Splink: blocking tutorial — candidate generation and the accuracy/performance trade-off.
- Splink: clustering API — connected-component clustering of thresholded pair predictions.
The organization scenario, proposed architecture, counterexample and calculations are original. The design adds application constraints beyond the referenced clustering primitive.
Continue your preparation
Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.