Design an object-oriented poker game
Company: Google
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Onsite
Design the object-oriented architecture for a command-line poker game.
## Requirements (clarify and state assumptions)
Assume a standard 52-card deck (no jokers). Support **N players** (e.g., 2–8). The system should:
1. **Model core entities**: cards, deck, players, hands, game/table.
2. **Shuffle and deal** cards correctly.
3. **Run a round** of poker (you may choose a concrete variant such as **5-card draw** or **Texas Hold’em**; state which one you implement).
4. **Evaluate and compare hands** to determine the winner(s), including ties.
5. Be **extensible** for future features (e.g., different poker variants, multiple rounds, betting rules).
## Deliverables
- Key classes/interfaces and their responsibilities.
- Relationships between objects (composition/inheritance where appropriate).
- Main flow for starting a game and completing one round.
- How hand ranking is implemented and tested.
Quick Answer: This question evaluates object-oriented design and system modeling skills, including abstraction, class responsibilities, object relationships, and domain-driven decomposition, alongside the ability to specify deterministic logic for comparing game outcomes; it is commonly asked to gauge architectural thinking, clarity in modeling complex rules, and designing extensible, testable systems. Classified under Software Engineering Fundamentals, the prompt is primarily a conceptual design exercise with practical implementation aspects for class/interface definitions and interactions, and this summary is provided in English.