Design product co-occurrence analytics API
SnapchatSoftware Engineer · OnsiteLast updated
This question evaluates design skills for RESTful APIs and backend systems, covering API schema and versioning, authentication and rate limiting, caching and cache invalidation, storage models, precomputation pipelines, consistency and staleness bounds, monitoring, and operational concerns.
Design RESTful APIs to serve co-purchase analytics. Define endpoints to: (a) fetch the top related products for a given product_id, (b) filter by time window, region, or channel, and (c) paginate results. Specify request/response schemas, authentication and authorization, rate limiting, caching and cache invalidation, SLA and timeouts, idempotency, and versioning. Describe the storage model and precomputation pipeline (e.g., batch aggregation or streaming), consistency expectations, and monitoring/alerting. Discuss how you would test the API and roll out changes safely.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.