Problem statement
Design the object model and core APIs for an UNO-style shedding card game: players match the top discard by color or value, action cards alter play, and the first to empty a hand wins the round.
Operating context. 2-10 players around a table share a draw pile and a discard pile. On a turn a player plays a card matching the top discard's color or value, or a wild; otherwise they draw. Action cards change the game: skip, reverse direction, draw-two, wild (choose a color), and wild-draw-four. A player down to one card must call UNO. When the draw pile empties, the discard (minus its top card) is reshuffled into it. A round ends when a hand is empty, scored from the cards left in opponents' hands. Single in-process session, no networking, no stakes.
Out of scope. Networking and matchmaking, AI opponents, stacking or jump-in house-rule variants beyond a rule seam, animation and UI, and cross-round tournament persistence.
What to produce. The class model (round, player, hand, card hierarchy of number/action/wild, deck with draw and discard piles, turn manager, rule set), the public API each exposes, and the play-legality check. Be explicit about how each action card's effect is dispatched polymorphically rather than by a switch on type, how turn order (direction, skip, current player) is one total transition, how the discard reshuffles into the draw pile, and how house rules plug in behind a seam.
Requirements
This assessment is a Premium feature.
The statement above is free to read. The functional and non-functional requirements, and the graded canvas that scores your design against them, come with Premium.
Topics
- System Design LLD
- Oop Polymorphism
- Patterns State
- Patterns Strategy
- Domain Card-Games