Airbnb·Software Engineer·Technical Phone Screen
- Design a data structure for a Connect-N game where pieces fall to the lowest empty cell in a column. Implement a move(column, player) function that returns true if the player has achieved N consecutive pieces in any direction after that move. What's your per-move time complexity and how does your algorithm work?
“My first instinct was to just scan the whole board after every move, which is obviously wrong for a senior-level question.”