Continuing from my last post.
Round 1
One of the interviewers asked upfront whether I wanted the AI-assisted question or the non-AI one. I picked AI.
Question 1
The problem was similar to comparing two poker hands: you're given a bunch of rules for ranking hands, the input is two string arrays, and the output is user1 or user2.
I started by stating a few assumptions and clarifications, then analyzed how the rules related to each other and decided to use the Strategy pattern — remembering not to just hardcode a pile of condition checks, but to abstract it out. I also worked out what data structure each rule needed for its comparison, weighing both vertically and horizontally, and settled on a map. Then I ran my approach by GPT to check it, and it came back with basically the same idea, generating some code and tests, which I ran to see the results.
Question 2 (follow-up)
Because of network issues, you might only receive part of a player's hand — how do you determine from the partial hands you do have whether it's a win, a loss, unknown, or a tie? (The interviewer's audio kept cutting out while reading the question, so it took me several minutes just to understand what was being asked — if anyone has a good way to handle that, let me know.) My approach was to only return a result once the outcome was fully determined or the hands were complete, and return "unknown" otherwise. GPT had a better approach: estimate each player's best-case and worst-case possible hand strength, and if one player's worst case still beats the other player's best case, you already have your answer. I didn't fully understand the prediction logic at first, and when the interviewer asked me to explain it, I could only mumble through a vague answer — ran out of time before I could finish.
Next round I'll talk about the absolutely terrible system design round.
Side note: the HR team was actually pretty solid — very supportive, both in how they communicated and how responsive they were.
Discussion
Loading comments…