Design a platform for sharing and selling handmade goods, with personalization, delivery, and dispute resolution.
Asked at
AI answer
Architecture
Start with a modular application and a relational database; as the system grows, split the catalog and search, orders, payments, shipping, notifications, and disputes into separate services. Store photos in object storage behind a CDN, and index the catalog in a search engine. Pass events between services through a queue using a transactional outbox and idempotent handlers.
Core entities and workflows
Seller,Product,Variant,PersonalizationOption,Order,OrderItem,Payment,Shipment,Dispute,Evidence.- For a personalized item, the order contains its parameters and the agreed version of the design/description. Changes are confirmed by the buyer and saved as history rather than overwriting the original agreement.
- At checkout, atomically lock in the price, availability or production lead time, and personalization terms. Prevent duplicate charges when a request is retried by using an idempotency key.
- Process payments through a provider; store tokens and statuses, but not bank card data. Funds can be held until shipment/delivery is confirmed, if permitted by the payment provider's rules and the relevant jurisdictions.
- Integrate shipping through carrier adapters: rate calculation, shipment creation, tracking number, and webhooks. Change order statuses using an explicit state machine.
- A dispute can be opened within a specified time limit. Store correspondence, agreement versions, photos, and delivery events; restrict access to this material to the parties involved and moderators. Audit dispute decisions and use them to trigger a refund/payout.
Reliability and security
Check seller and buyer permissions for every object, restrict file uploads, scan files, and protect personal data and addresses. Use change auditing, rate limiting, and antifraud checks. Metrics: conversion rate, payment errors, shipping delays, dispute frequency, and time to resolve disputes. Define SLOs, alerts, and event reprocessing procedures for payments and orders.
Also asked at IBS
- Suppose a virtual machine has no CPU load and no RAM pressure, but its load average is huge and the server is really lagging. Where would you look, and what might be the problem?
- How do you perform a forensic analysis of a compromised container that was deleted but whose Linux audit logs were retained?
- How do you use SELinux or AppArmor for container profiles in a production environment to restrict access to the host file system?
- What is the difference between bridging, masquerading, and routing in the context of Docker/Kubernetes networking?
- Which TCP parameters (sysctl) do you change for low-latency, high-load HTTP services?
Similar questions
- Design a platform for exchanging and selling books, with licensing, delivery, and returns.
- Design a platform for handling complaints about product quality, including photos, returns, and disputes between sellers and buyers.
- Design a platform for exchanging and selling event tickets with protection against scalping and fraud.
- Design a platform for organizing courses, including schedules, payments, and certificates.
- Design a platform for sharing and selling photographs with watermarks, licenses, and protection against unauthorized use.