I just finished my Temu phone screen.
First round (coding):
The problem was a variant of a 2D matrix problem.
Part one: given an m x n matrix, output all the values in the matrix in spiral order (clockwise, from the outside in). It's a classic, similar to LC 54 Spiral Matrix.
Follow-up: what if the matrix has some blockers (obstacles)? During the traversal, whenever you hit a blocker you have to turn, and the turning order is also clockwise (turn right). What is the final output order in that case?
Discussion
Loading comments…