The interview problem
A customer viewing a camera wants useful accessories, not more cameras. Design recommendations that distinguish complements from substitutes and enforce product compatibility.
Original practice, not a reported company interview. All worked numbers are illustrative. Interview date: not applicable. Written October 3, 2026.
1. Scope and assumptions
Assume a catalog with structured compatibility data of uneven quality. Optimize successful accessory purchases with return-rate guardrails. Co-purchase is a useful signal but not proof of compatibility or incremental value.
2. Architecture and decisions
Anchor product → compatible category candidates → relation model → stock and compatibility gate → ranked accessories
Generate candidates from verified compatibility links, category rules and learned co-purchase relationships. Represent directed relations: a battery may complement a camera, but a camera is not necessarily a useful recommendation when viewing a battery. Train with time-based splits and distinguish exposure from missing feedback. Purchased-together negatives are not automatically substitutes.
Apply hard compatibility and availability checks after scoring, then diversify by accessory function. Keep an explanation tied to verified attributes, such as the supported mount, rather than inventing a reason from embedding similarity. For new products, use manufacturer attributes and conservative category rules until interaction evidence accumulates.
3. Work through the example
Across 10,000 eligible camera sessions, 200 include battery B. If 80 of 1,000 sessions for camera A include B, P(B|A)=8% versus a 2% overall rate, giving lift 4. That association can reflect a bundle promotion; it does not establish that displaying B causes additional purchases.
4. Failure cases and trade-offs
Popular accessories dominate raw counts. Promotions and bundled orders create confounding. Incorrect compatibility causes expensive returns even when click-through rises. Rules offer precision but limited coverage; learned relations expand coverage while requiring calibrated abstention and structured constraints.
5. Validation and acceptance
Hold out future purchases and newly introduced products. Evaluate compatibility violation rate and accessory-category coverage before online tests. In an experiment, measure net useful purchases and returns, not only clicks. Inspect cases where an accessory is already owned or included in the box.
6. Follow-ups and self-review
How would you handle missing compatibility metadata? Reward relation-specific candidates, causal humility, hard constraints and return-aware evaluation.
Sources and related practice
McAuley and colleagues study substitutable and complementary product relations; this camera scenario and evaluation plan are original.
Read the primary technical reference
Reference retrieved October 3, 2026. Retrieval date is not an interview or source publication date. The reference supports the named concept; scenario, architecture, examples and rubric are original.
Continue with Match catalog products across merchants; Rerank recommendations for diversity and coverage.
Continue your preparation
Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.