LLD - Design — Splitwise (Expense Sharing)How would you combine percentage and exact split strategies in a system to handle complex billing scenarios?AConvert all splits to equal shares internallyBAllow users to specify exact amounts and percentages, then validate total matchesCForce all splits to be either exact or percentage, not bothDIgnore exact splits and use only percentage splitsCheck Answer
Step-by-Step SolutionSolution:Step 1: Support mixed input typesAllow users to input both exact amounts and percentages for flexibility.Step 2: Validate combined splitsEnsure the sum of exact amounts plus percentage shares equals total amount.Final Answer:Allow users to specify exact amounts and percentages, then validate total matches -> Option BQuick Check:Mixed splits need validation for correctness [OK]Quick Trick: Validate combined splits sum to total amount [OK]Common Mistakes:MISTAKESDisallowing mixed splitsConverting all to equal sharesIgnoring validation
Master "Design — Splitwise (Expense Sharing)" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Design — Chess Game - Why chess tests polymorphism and strategy - Quiz 12easy Design — Chess Game - Piece movement rules (polymorphism) - Quiz 10hard Design — Food Delivery System - Why delivery systems test service coordination - Quiz 8hard Design — Hotel Booking System - Room type hierarchy - Quiz 8hard Design — Hotel Booking System - Why booking tests availability and concurrency - Quiz 8hard Design — Online Shopping Cart - Why e-commerce tests real-world complexity - Quiz 6medium Design — Online Shopping Cart - Order state machine - Quiz 4medium Design — Online Shopping Cart - Product, Cart, Order classes - Quiz 9hard Design — Online Shopping Cart - Notification on state change - Quiz 15hard Design — Splitwise (Expense Sharing) - Why Splitwise tests financial logic - Quiz 10hard