Original practice scenario: A hypothetical marketplace combines seller discounts, platform vouchers and shipping offers in a basket with several sellers. Design a deterministic pricing calculation and explainable result.
Read model answer +
Define promotion scope, ordering and rounding before implementing the calculator. Different rule orders can produce different totals even when each individual discount is calculated correctly.
Work through it
Represent immutable basket lines with seller, currency, quantity and eligibility attributes, then classify promotions as line, seller-subtotal, basket or shipping rules.
Apply a declared precedence and conflict policy, recording each rule's eligible base and allocated adjustment with exact monetary arithmetic.
Return an itemized calculation trace and test thresholds, incompatible vouchers, partial returns and empty eligible populations, retaining the pricing rule version.
Tradeoffs to discuss
A flexible rule system supports varied campaigns but increases interaction complexity; restricting combinations makes results easier to explain.
Common pitfalls
Do not apply a seller-specific voucher to another seller's subtotal.
A return allocation must conserve the original charged amount rather than recompute a different current promotion.
Original practice scenario: A hypothetical cross-border marketplace searches listings with translated titles, inconsistent size units and duplicated seller descriptions. Design an evaluation beyond keyword matching.
Read model answer +
Separate semantic relevance from attribute compatibility. A search result can describe the right product category while offering the wrong size, connector or quantity.
Work through it
Create reviewed query-listing cases across languages and locales, preserving structured attributes and their units alongside original and translated text.
Compare lexical, embedding and hybrid retrieval baselines, evaluating category relevance and required-attribute satisfaction separately on held-out queries and sellers.
Inspect ambiguous translations, unit conversions and duplicate listings, then measure useful result coverage with latency and low-confidence handling.
Tradeoffs to discuss
Structured filters improve compatibility but depend on reliable catalog attributes; semantic retrieval finds varied wording while potentially overlooking hard constraints.
Common pitfalls
Do not count a near-duplicate seller listing in both training and evaluation as independent evidence.
A high similarity score is not proof that dimensions or electrical compatibility match the user's requirement.