Meta·Software Engineer·Onsite - Coding / Algorithms
May 2026
Coding round at Meta with five pretty meaty algorithm problems back to back. The questions ranged from matrix traversal to tree stuff to a maze problem with four sub-parts, so there was a lot of ground to cover. Not sure how I did on the harder maze variants.
- Given an m x n integer matrix, return all elements in diagonal order where cells sharing the same row+column sum are grouped together, and the traversal direction alternates between diagonals (up-right then down-left). Handle the empty matrix case.
- In a binary tree where each node holds a single digit 0-9, each root-to-leaf path forms a number by concatenating digits top to bottom. Return the total sum of all such numbers.
- You have a nested list where each element is either an integer or another nested list. Return the sum of all integers, each weighted by its nesting depth (outermost list = depth 1).
- Each node in a binary tree has left, right, and parent pointers. Given references to two nodes but not the root, find their lowest common ancestor.
- A ball rolls in a grid (0 = open, 1 = wall) and only stops when it hits a wall or boundary. Implement four things: (a) can the ball reach the target stop cell, (b) minimum cells traveled to reach the target or -1, (c) if a hole exists that catches the ball when it passes over, return the lexicographically smallest direction string among all shortest paths, (d) how would you optimize for repeated queries on the same static maze.
“I knew the diagonal grouping trick (row+col = constant) but fumbled the direction alternation logic.” The rest of the author's notes on Software Engineer interview at Meta, Onsite - Coding / Algorithms round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post