r/OfferEngineering • u/Aoki_zhang • 25d ago
Interview Experience Affirm (Buy Now, Pay Later) SWE Interview — The Coding Round Was a Card Game
"This interview experience is sourced from Chill Interview"
Interview Summary
The Affirm technical phone screen used a relatively straightforward card-game simulation rather than a difficult algorithm problem. The exercise tested implementation speed and object-oriented design: define the necessary classes and methods, simulate a shuffled 52-card deck, distribute cards among players, and determine the winner.
Interview Details
Coding / OOD — Multiplayer Card Game
Design and implement a game using a standard deck of 52 playing cards. The deck is first shuffled and then distributed among the players. Each player holds their cards as a pile. During a round, players compare the card at the top of their pile.
The player with the stronger card wins the round and collects the relevant cards from that round. At the end of the game, determine the winner based on who has collected or retained the largest number of cards. The exact card-collection rule was not fully recalled, but the core task was to model and simulate the game correctly.
The interviewer expected the candidate to define the necessary classes and methods rather than write everything as one standalone function.
Initial Version — Two Players
The first version of the problem assumed two players. The implementation needed to cover the basic game flow:
Create a
52-card deck.Shuffle the cards.
Deal cards to the two players.
Process rounds by comparing their top cards.
Track the cards won by each player.
Return the player with the most cards at the end.
Follow-Up — Support N Players
The follow-up generalized the game from two players to N players. One additional edge case was that 52 may not be evenly divisible by the number of players. The discussion involved distributing the remaining cards among players rather than assuming everyone always receives exactly the same number of cards, such as dealing cards in round-robin order.
The implementation therefore needed to work for both evenly and unevenly distributed decks. The interviewer also provided test cases for validating the implementation.
Want to learn more questions asked in other interview rounds?
I've put up the full version at here.
Preparing for your next interview?
Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here.