Smallest Common Region
A medium-tier problem at 68% community acceptance, tagged with Array, Hash Table, String. Reported in interviews at Airbnb and 0 others.
Smallest Common Region is a medium-difficulty problem that Airbnb has used in their assessment. You're given a tree structure representing geographic regions and need to find the lowest common ancestor. The 67.9% acceptance rate means most candidates who see it do pass, but that's because they recognize the pattern. If you don't, you'll waste time on graph traversal or brute force approaches. The problem tests whether you understand tree ancestry chains and can implement DFS efficiently. StealthCoder becomes your safety net if this hits your live OA and the tree structure isn't immediately clear.
Companies that ask "Smallest Common Region"
Smallest Common Region is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.
Get StealthCoderThe core trick is treating the region hierarchy as a tree and finding the deepest node that's an ancestor to both input regions. Most candidates miss this and try iterating through all regions, which bloats complexity. The actual solution chains from each region up to the root, storing ancestors in a hash table or set, then walks up from one region until you hit a stored ancestor from the other. Depth-First Search is the natural fit here. The pitfall is not recognizing that you can pre-build parent pointers or ancestry paths. Once you see it as a classic Lowest Common Ancestor problem, the code is straightforward. If you blank on the pattern under pressure, StealthCoder solves it invisibly during screen share and surfaces a working DFS or BFS solution in seconds.
Pattern tags
You know the problem.
Make sure you actually pass it.
Smallest Common Region recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Smallest Common Region interview FAQ
Is this really just Lowest Common Ancestor in a tree?+
Yes. The problem wraps it in geographic language, but the structure is a tree where each region has one parent. Once you recognize that, you can apply standard LCA techniques: store ancestors in a set and walk from one node until collision, or find depths and walk together. The input format is slightly different, but the algorithm is textbook.
Why is the acceptance rate so high if people find it hard?+
The 67.9% rate reflects that most candidates either know tree patterns going in or have seen LCA before. Those who don't recognize the pattern struggle more. It's a signal that you need to be solid on DFS and ancestry traversal, not that the problem is trivial.
Do I need BFS or is DFS always better here?+
DFS is more natural because you're walking parent chains upward. BFS would work if you're building a graph, but it's overkill. The Hash Table topic hints you'll store ancestors, and DFS from each region is the cleanest path. Both are acceptable, but DFS is faster in practice.
What's the most common mistake candidates make?+
Trying to iterate through all regions and check every pair, or building a full graph when you really just need parent pointers. The other mistake is not recognizing you can preprocess ancestors into a set. These approaches cost time and space. The aha moment is storing one region's path and matching against the other.
How does this relate to the String and Array topics?+
Regions are usually passed as strings, and the input is an array of region pairs. You may need to parse region names or manipulate the input structure slightly. The core algorithm stays tree-based, but String and Array handling are the glue around the main logic.
Want the actual problem statement? View "Smallest Common Region" on LeetCode →