I had reviewed nothing but hard problems and never reviewed this easy kind of one, and of course that's what I got. Ha. The problem: 52 playing cards, shuffle first, and each person takes a pile. Each round you compare whose top card is bigger. The side with the bigger card seems to take the other side's card too and put it aside together with their own (I forgot the exact rules, but I think that's how the game is played). At the end you compare who has the most cards and output the winner. It started as a 2-player game, and the follow-up was to extend it to N players. With N players the cards may not be dealt out evenly, and I think you were supposed to take the count modulo the number of players and give the leftover cards to the players who didn't get enough. You had to define your own classes and methods. Test cases were provided (probably only because I'm so bad at this).
Affirm Software Engineer Interview Experience — Failed the Easy Card Game Problem in the Technical Screen
Technical Screenhard
Published
Curated and edited by PracHub
Discussion
Loading comments…