0
0
LLDsystem_design~20 mins

Order tracking state machine in LLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Order Tracking Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Identify the correct next state in an order tracking state machine

An order tracking system has the following states: Placed, Confirmed, Shipped, Delivered, and Cancelled. Which state should the order transition to immediately after Placed?

AConfirmed
BShipped
CDelivered
DCancelled
Attempts:
2 left
💡 Hint

Think about the logical flow of order processing after a customer places an order.

Architecture
intermediate
2:00remaining
Choose the best component to handle order state transitions

In designing an order tracking system, which component is best suited to manage the state transitions of orders reliably?

AA stateless REST API endpoint
BA state machine service with persistent storage
CA client-side JavaScript function
DA simple database table without logic
Attempts:
2 left
💡 Hint

Consider where state and logic should be maintained to ensure consistency and reliability.

scaling
advanced
2:30remaining
Scaling order state updates under high load

Your order tracking system must handle thousands of state updates per second during peak sales. Which approach best supports scaling these state transitions?

APartition orders by region and use distributed state machines per partition
BProcess all state transitions synchronously in a single service instance
CUse a single centralized database with strong locking for state updates
DStore states only in cache without persistence
Attempts:
2 left
💡 Hint

Think about how to distribute load and avoid bottlenecks.

tradeoff
advanced
2:30remaining
Tradeoff between consistency and availability in order state updates

In a distributed order tracking system, choosing between strong consistency and high availability for state updates is a key tradeoff. Which statement best describes this tradeoff?

AChoosing availability means the system never loses data even if nodes disagree on state
BConsistency and availability can always be achieved together without tradeoffs
CHigh availability means all nodes always have the latest state with zero delay
DStrong consistency guarantees all nodes see the same state immediately but may reduce availability during network issues
Attempts:
2 left
💡 Hint

Recall the CAP theorem and its implications for distributed systems.

estimation
expert
3:00remaining
Estimate storage requirements for order state history

Your system tracks the full state history of each order. Each state change record is 200 bytes. You expect 1 million orders per day, each with an average of 5 state changes. Estimate the storage needed for one month (30 days) of state history.

A3 trillion bytes (3 TB)
B300 billion bytes (300 GB)
C30 billion bytes (30 GB)
D30 trillion bytes (30 TB)
Attempts:
2 left
💡 Hint

Calculate total records and multiply by record size, then convert bytes to GB.