0
0
LLDsystem_design~20 mins

Pricing strategy (discounts, coupons) in LLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Pricing Strategy Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Discount Application Order

In a pricing system, a customer can apply a 10% discount coupon and a $5 fixed discount coupon. Which order of applying these discounts results in the lowest final price?

AApply only the higher discount, ignoring the other
BApply both discounts simultaneously by adding their values
CApply the 10% discount first, then subtract $5
DSubtract $5 first, then apply the 10% discount
Attempts:
2 left
💡 Hint

Think about how percentage discounts affect the price after fixed discounts.

Architecture
intermediate
2:00remaining
Designing Coupon Validation Component

Which component design best supports validating multiple coupon types (percentage, fixed amount, buy-one-get-one) in a scalable pricing system?

AA single monolithic validator that checks all coupon rules in one place
BSeparate validator classes for each coupon type implementing a common interface
CHardcoded if-else statements inside the pricing engine for each coupon type
DValidate coupons only on the client side before sending to server
Attempts:
2 left
💡 Hint

Consider maintainability and adding new coupon types in the future.

scaling
advanced
2:00remaining
Scaling Coupon Redemption System

Your e-commerce platform expects a sudden surge of 1 million coupon redemptions in one hour during a sale. Which approach best ensures system reliability and prevents coupon overuse?

AImplement distributed counters with eventual consistency and retry logic
BUse a centralized database with strong locking for coupon usage counters
CAllow unlimited coupon redemptions and reconcile usage offline later
DDisable coupons during high traffic to avoid race conditions
Attempts:
2 left
💡 Hint

Think about balancing consistency and performance under high load.

tradeoff
advanced
2:00remaining
Tradeoff Between Coupon Expiry Checks

Should coupon expiry be checked at coupon issuance or at order checkout? What is the main tradeoff?

ACheck at checkout to ensure validity but increase checkout latency
BCheck both at issuance and checkout to double confirm validity without tradeoffs
CCheck at issuance to reduce checkout latency but risk expired coupons being issued
DNever check expiry to simplify system design
Attempts:
2 left
💡 Hint

Consider user experience and system performance impacts.

estimation
expert
2:00remaining
Estimating Storage for Coupon Usage Logs

Your system logs every coupon redemption with user ID, coupon ID, timestamp, and order ID. Estimate the storage needed per day if you expect 500,000 redemptions daily. Assume each log entry is 200 bytes.

AApproximately 100 MB per day
BApproximately 100 GB per day
CApproximately 10 GB per day
DApproximately 1 GB per day
Attempts:
2 left
💡 Hint

Multiply number of entries by size per entry and convert bytes to GB.