List the key functional requirements for the system (Ask the AI for hints if stuck)...
List the key non-functional requirements (performance, scalability, reliability, etc.)...
Estimate the scale of the system. Consider daily active users, read/write ratio, storage requirements, bandwidth, and any relevant QPS calculations...
Define the APIs expected from the system. This is your chance to analyze and define the read and write paths so that you can come up with the high-level design...
"query": "dog food",
"products": [
{
"productId": "prod_501",
"name": "Pedigree Adult Dry Dog Food - Chicken & Vegetables (3 kg)",
"brand": "Pedigree",
"category": "Pet Supplies",
"price": 699.00,
"originalPrice": 780.00,
"currency": "INR",
"rating": 4.5,
"reviewCount": 3240,
"inStock": true,
"thumbnailUrl": "https://example.com"
},
{
"productId": "prod_508",
"name": "Royal Canin Maxi Adult Dry Dog Food (4 kg)",
"brand": "Royal Canin",
"category": "Pet Supplies",
"price": 2450.00,
"originalPrice": 2700.00,
"currency": "INR",
"rating": 4.7,
"reviewCount": 1120,
"inStock": true,
"thumbnailUrl": "https://example.com"
}
]
}
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
The system will have a microservices architecture. User service will be responsible for user account registration and maintaining user profile. Products service will be fetching products list on searching and products page. Recommendation service is for generating recommendations for customer. Order service is for placing orders and return / refund workflows, when any order updates take place it updates notification service and inventory service via message queue. Inventory service manages the stock of all products. Cart service is responsible for maintaining user's cart and its state. For faster load time, static files are stored in CDN and popular products data is kept in redis cache.
Define the data model. Identify the main entities, their attributes, and relationships. Consider the choice of database type (SQL vs NoSQL) and justify your decision based on access patterns...
Tables:
Relationships:
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.
PENDING status and redirects the user to Stripe to complete the payment, updating both the payment status and order status once Stripe confirms the transaction.RETURN_REQUESTED. Once the returned item is received and verified, the service processes the refund via Stripe and publishes an event to the message queue so the Inventory Service can restock the item and the Notification Service can alert the user.