Meta·Software Engineer·Technical Phone Screen
- Given a 2D grid maze with keys and locked doors, find the minimum number of steps to travel from the start to the exit, where doors can only be passed if you've already collected the matching key.
- You have a large list of words and a large list of queries. For each query, find the word with the longest common suffix, using word length and then index as tiebreakers. Brute force is too slow at scale, so implement something better and benchmark it.
“My first instinct was plain BFS and I coded half of it before realizing the state space is wrong.”