Level: Senior-Level
Round: Phone Screen · Type: Coding · Difficulty: 7/10 · Duration: 60 min · Interviewer: Neutral
Topics: Object-Oriented Design
Location: San Francisco Bay Area
Interview date: 2026-01-22
Got offer: False
I had a phone screen interview. The question was to design a Poker game using object-oriented principles.
I had a phone screen interview that lasted an hour. After introductions and a Q&A, I had about 40 minutes to work on the coding question, which involved designing a simplified Poker game using object-oriented principles. I had seen this problem before in interview preparation, but I didn't practice implementing it. I focused on Delivery Cost and Expense Rules systems instead. Because I wasn't well-prepared and it was my first interview, I was nervous and slow. I didn't finish Part 2. I think there were three parts, and from what I've heard, you need to complete Part 2 to move forward.
The coding question I got was:
/*
Let's build a card game called Camel Cards, a simplified version of Poker.
In Camel Cards, there are two players, each with a hand, and your goal is to determine which player has the stronger hand.
Each hand consists of four cards.
Cards are ordered and labeled with one of:
9, 8, 7, 6, 5, 4, 3, 2, 1
(9 is the highest, 1 is the lowest)
Each hand is classified into exactly one hand type. From strongest to weakest, the hand types are:
- Four of a kind – all four cards the same (e.g., 9999)
- Two pair – two cards the same + two cards the same (e.g., 2332)
- Three of a kind – three cards the same + one different card (e.g., 9998)
- One pair – two cards the same + two distinct others (e.g., 5233)
- High card – all cards distinct (e.g., 2345)
In the future, we will introduce many more hand types, so design your solution to make it easy to add more hand types.
Ordering Rules:
Hands are primarily ordered by type (e.g., any two pair beats any three of a kind).
If two hands have the same type, compare card-by-card from most recently dealt to first dealt [right to left]. You should not sort the cards.
The first higher card wins.
If cards are equal, continue to the left.
If all are equal, it's a tie.
Task:
Implement the function:
* `evaluate (hand1 [string], hand2 [string])`
- Returns "HAND_1" if hand1 wins, "HAND_2" if hand2 wins, or "TIE" if the result is a tie.
We want to see good OOP practices.
2332, 2442,
You may look up syntax using a search engine.
*/