Amazon Interview Question

Design a blackjack card game, focusing on OO design.

Interview Answer

Anonymous

Mar 24, 2013

Focus on every participant object Maybe: Card (with value + enum clubs/diamonds/hearts/spades) Deck (List of Cards + method shuffle and getFirst) Player (with name + method doNextMove that return enum Action - getNewCard or Stop) Game (with N Players, 1 Deck, iterate over Players, foreach Player iterate over their doNextMove until they die or they decide to stop) At the end, evaluate each Player sum and declare winner.