Team: e-commerce
Interview language: Chinese
Round: first round
It went straight into coding. I had GPT reconstruct the coding question, so just bear with it:
The problem is a modified version of LeetCode 348 Design Tic-Tac-Toe. The difference is that it doesn't ask you to design a TicTacToe class and move(). Instead you're given the current n x n board directly and you implement GameOver(board) to decide whether the game is over. The return value also changed from 0/1/2 to True/False, and it adds draw detection for when the board is full but there's no winner. My solution just iterated over all the rows, columns, and both diagonals, then checked whether there was any empty cell left. Time complexity O(n^2), space complexity O(1).
When you run it, you have to write your own test cases, one for each scenario.
Follow-up 1: optimize the time complexity. My optimized result in the end was O(n), and he said that was still too high, so the next one, follow-up 2, was to optimize it to O(1). I got it.
While coding I found bugs myself and fixed them, mostly typos and alignment issues. By the time I ran it, it was bug free.
No resume questions and no textbook fundamentals questions. Maybe the coding just used up exactly all the time, so there was no time left to ask them. I was told on the spot that I passed.
The interviewer had a good attitude, not nearly as scary as people online make it sound.
But HR still hasn't contacted me after two business days, and they don't reply to my emails about the next step either. What's going on here? Are they on vacation, or have they already filled the position?
Discussion
Loading comments…