Design a Retail POS Ingestion and Next-Day Stockout Forecasting System
Design a data platform for a large retail chain that ingests approximately 1.2 billion daily point-of-sale transactions in near real time via a rate-limited REST API and uses the ingested data to predict which products will stock out in each store the following day, enabling timely restocking decisions.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late February, 2026
Description: A large retail client operates thousands of stores. Their Point of Sale (POS) systems generate about 1.2 billion transactions per day, with peaks of around 100 million per hour. The client wants a data platform that ingests these transactions in near real time and uses them to predict stockouts. Part 1: Ingestion Transactions are only available through the client's REST API: GET /transactions/{timestamp} returns the transactions for a 5-minute window. The response is paginated (around 1,000 transactions per page). A second endpoint fetches transactions by transaction_id, also paginated. The API is rate-limited to 50 concurrent connections. Data in the platform must be no more than 15 minutes old. Design the ingestion pipeline from the API into an analytics platform. Explain how you get through pagination within the connection limit, how you handle failures without losing or duplicating data, and how you store the data for analytics and ML. Part 2: Demand forecasting Using the ingested data, the business wants to predict which products will stock out in each store the next day, so it can restock in time. Design the ML solution: what features you'd use, what model, and what the output looks like. Then explain how you'd evaluate it, serve the predictions, and monitor and retrain it over time.
Your account is free and you can post anonymously if you choose.