The interview problem

Practice prompt

Match one million changed merchant listings per day against ten million canonical purchasable variants. Use images, text and attributes to return an exact variant, a family-only relationship, no match or insufficient evidence. Prevent shared stock photography from merging different sizes, colors or pack counts. Explain training, evaluation, review costs and corrections.

Original ML-design practice, not a reported company interview. All workloads and metrics below are hypothetical. Primary research context retrieved September 27, 2026; interview date not applicable.

1. Define exact identity before training

For this exercise, an exact match means the same manufacturer model or revision and the same required variant attributes. Maintain a category-specific contract: capacity, size, color, pack count, regional voltage, included accessories and condition may determine whether two listings represent the same purchasable variant.

Keep seller identity, price, shipping and stock as offer properties rather than overwriting them with a canonical product record. Decide explicitly whether refurbished condition or a bundle gets a separate identity. A visually similar substitute can be useful in search while still being a wrong exact match.

Use four outcomes. Exact means the identity contract is satisfied. Family-only means product lineage is established but only a different or unresolved variant can be supported. No match means no exact catalog identity is supported after adequate search. Insufficient evidence means missing or contradictory information prevents that conclusion. If lineage itself is unproven, use insufficient evidence rather than family-only. These are evidence-qualified decisions, not guarantees that candidate search found everything. Missing fields are not wildcards.

2. Work through misleading images

The incoming listing is an Acme Trail T7 bottle, 750 mL, blue, single-pack. Consider these candidates:

CandidateEvidenceDecision
AIdentical stock photo; T7, 500 mL, blueSame family, wrong capacity
BDifferent camera angle; T7, 750 mL, blue, one bottleExact, if the evidence is trustworthy
CIdentical stock photo; T7, 750 mL, blue, two-packSame family, wrong pack count
DText says 750 mL and blue; model and pack count absentInsufficient evidence for exact identity

A visual embedding may rank A or C above B. That can be acceptable for family retrieval but not for automatic identity linking. Keep extracted values together with their source, confidence and observation version. OCR from an old packaging image can conflict with current merchant text; high visual similarity cannot resolve that conflict by itself.

3. Retrieve broadly, decide narrowly

versioned merchant offer ingestion
                ↓
attribute normalization + OCR + image/text representations
                ↓
union of identifier, lexical and visual candidate retrieval
                ↓
pair scorer with explicit variant comparisons
                ↓
calibrated link / review / reject decision
                ↓
versioned offer-to-canonical relationship and evidence

Start with trusted identifiers and normalized attribute rules as a baseline. Add lexical and image retrieval to recover listings with missing or noisy identifiers. Use the union of candidate sources, deduplicated by canonical variant ID. An identifier is strong evidence only when its provenance and granularity are reliable; a parent SKU or copied identifier may identify a family or an incorrect product.

The final scorer compares model, capacity, pack count and other relevant fields, not just a single fused similarity score. Reliable incompatible attributes can veto automatic linking. Less reliable conflicts route to review rather than being silently discarded.

Store relationships separately from original offers. Preserve the input listing, normalization version, model version, candidate set and decision evidence. A correction should reverse an edge without reconstructing data destroyed by a physical merge.

4. Train on exact positives and difficult negatives

Build reviewed positive pairs across merchants, camera angles and languages that satisfy the exact identity contract. Include sibling sizes, colors, pack counts, revisions and compatible accessories as hard negatives. Co-clicks and shared shopping sessions indicate relatedness, not necessarily exact identity.

A contrastive retrieval model can improve candidate coverage, followed by a pair classifier trained to distinguish exact variants. Keep the two objectives explicit: family-level relevance labels alone cannot train or validate exact linking. Unknown pairs should not automatically become negatives merely because identifiers are missing.

Split evaluation by canonical family and time where possible. Repeated stock photos and sibling variants can otherwise leak between training and test data. Also hold out merchants to measure changes in photography, field quality and naming conventions. Report performance when key attributes are absent rather than evaluating only clean listings.

Normalize units carefully, such as liters versus milliliters, while preserving the original value. Do not normalize a two-pack into a single unit if pack count is part of identity. A model should receive missingness and contradiction indicators rather than fabricated equal values.

5. Separate family retrieval from exact linking

Consider a labeled evaluation of 1,000 incoming offers. Exactly 800 have an exact variant somewhere in the catalog; 200 do not. Among those 800 matchable offers, the top 100 candidates contain the correct family for 760 and the exact variant for 680:

family recall@100 = 760 / 800 = 95%
exact-variant recall@100 = 680 / 800 = 85%

The family metric hides 80 cases where a related product was found but the exact variant was missed. A downstream scorer cannot select a variant absent from its candidate set.

Suppose the system automatically links 600 offers: 570 correctly, 20 to wrong sibling variants and 10 despite no exact match existing. Assume all correct links come from the stated candidate sets.

exact-link precision = 570 / 600 = 95%
end-to-end exact-link recall = 570 / 800 = 71.25%
automatic link coverage = 600 / 1,000 = 60%
correct-link rate among exact-retrievable cases = 570 / 680 ≈ 83.82%

The last quantity is not precision: its denominator is all offers with a retrievable exact candidate, including ones the system abstained on. The 400 offers not automatically linked must be separated into review, rejection and unresolved outcomes. Coverage does not say whether those decisions were correct.

Audit no-match offers and rejected offers as well as accepted links. Reviewing only automatic matches cannot measure missed matches or candidate recall. Report uncertainty around estimates and slice by category, merchant, variant complexity and missing attributes. These numbers are a worked example, not a claim about a deployed model.

6. Translate decision costs into a threshold

For a simplified binary pair decision, let p be the calibrated probability of an exact match. Assume a false link costs 100 units, a missed link costs two, and correct decisions cost zero:

expected loss(link) = 100(1 − p)
expected loss(reject) = 2p

link when 100(1 − p) < 2p
          p > 100/102 ≈ 0.980392

This threshold applies to the stated two-action loss model, not universally to every category or workflow. Human review introduces its own cost, error probability and delay. Multiple competing candidates also require a coherent final selection rule rather than independently linking every pair above threshold.

Calibrate on representative held-out candidate pairs under the serving retrieval policy. A model trained with heavily oversampled hard negatives may have useful rankings but probabilities that do not match production prevalence. Evaluate reliability near the acceptance threshold and under merchant shifts.

Keep trusted attribute incompatibilities outside the automatic-link path even if an imperfect model is overconfident. Missing evidence should generally reduce the scope of what is claimed, not be replaced by a high cosine similarity.

7. Budget model serving and human review together

Assume one 768-dimensional vector per canonical variant stored at two bytes per component:

10,000,000 × 768 × 2 bytes = 15.36 GB
three copies = 46.08 GB

These decimal values exclude ANN indexes, metadata, source images and multiple image views. Actual retrieval memory and update cost can be substantially larger. Version index refreshes so changed attributes and stale vectors do not silently describe different listing revisions.

If each of one million daily updates scores 100 candidate pairs:

100 million pairs/day ≈ 1,157.41 pairs/second average
hypothetical five-times peak ≈ 5,787.04 pairs/second

worker benchmark = 200 pairs/second
70% operating target = 140 pairs/second
workers for peak = ceiling(5,787.04 / 140) = 42

The benchmark is assumed and excludes retrieval, feature extraction and other bottlenecks. Check batch size and tail latency before using it as a capacity promise.

For a separate operational sizing assumption, suppose two percent of daily updates need human review, averaging 45 seconds each. This rate is not inferred from the earlier 60% automatic-link coverage; other unlinked offers can be rejected or remain unresolved:

20,000 reviews/day × 45 seconds = 250 review-hours/day
at six productive hours per reviewer:
ceiling(250 / 6) = 42 reviewers

This is workload-equivalent daily staffing, not a shift plan with absence, escalation or burst headroom. A high-precision model with an unfunded review queue can still fail operationally. Prioritize review by expected harm and uncertainty, while leaving low-priority cases explicitly unresolved.

8. Make links reversible as listings change

A merchant may edit an existing listing from a single-pack to a bundle while retaining its listing ID. Detect changes to identity-defining attributes, invalidate affected relationship decisions and re-evaluate them. A cached embedding keyed only by listing ID can otherwise keep the old match alive.

Do not automatically use transitive closure of uncertain pair links to merge an entire family. A–B and B–C predictions do not prove that A and C satisfy all required variant attributes. Validate compatibility against the canonical identity and retain conflicting evidence for review.

Roll back erroneous relationships and identify downstream consumers that already used them. Reverting a model version does not undo exported catalog merges or pricing comparisons. Publish relationship revisions with an audit trail, and give consumers a correction mechanism.

Failure analysis

FailureRiskResponse
Shared stock photographyWrong size or pack linkedExplicit variant comparisons and hard negatives
Copied or parent-level identifierFalse confidence in an exact matchValidate provenance and identifier granularity
Missing pack countUnknown treated as agreementReturn insufficient evidence or review
Unit normalization errorDifferent capacities appear equalPreserve raw values and test conversions
Merchant edits identity fieldsOld relationship becomes wrongVersion inputs and invalidate affected links
Review queue exceeds capacityUnresolved cases silently auto-linkBound queue policy without relaxing identity claims

The reviewer interface should show conflicting attributes and source evidence alongside images. A gallery of similar photos alone encourages the same mistakes as the visual model. Audit reviewer disagreement and feed corrected labels back through a versioned training process.

Trade-offs and follow-ups

  • Why not use image search directly? Similarity can retrieve the right family while missing the exact variant contract.
  • Why combine retrieval sources? Identifiers, text and images fail differently, but broader candidates increase scoring cost and require independent recall evaluation.
  • What if all candidates lack a required attribute? Return insufficient evidence or request review; do not invent an exact match.
  • How should rollout begin? Shadow evaluation, then limited automatic links in validated slices with audited errors and reversible decisions.
  • What makes this successful? Low harmful false-link rates at useful coverage, measured end to end with a sustainable review and correction process.

Self-review rubric

A strong answer defines exact identity, preserves attribute evidence and distinguishes family retrieval from exact linking. It uses difficult sibling negatives, leakage-resistant splits and calibrated decision costs. An excellent answer budgets review workload, handles no-match and unknown outcomes, detects changed listings and reverses downstream effects of mistaken links.

Sources and attribution

Retrieved September 27, 2026. The abstract describes catalog images, metadata and cross-domain multi-view object retrieval. It provides research context, not evidence of cross-merchant exact-variant performance or a reported Amazon interview. The architecture, bottle example, metrics and calculations are original practice; no external benchmark result is claimed.

Continue your preparation

Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.