Pyramid Transition Matrix
A medium-tier problem at 53% community acceptance, tagged with Bit Manipulation, Depth-First Search, Breadth-First Search. Reported in interviews at Airbnb and 0 others.
Pyramid Transition Matrix is a medium-difficulty problem that Airbnb has reportedly asked. You're given a grid of blocks that must stack into a pyramid, where each pair of adjacent blocks determines what block can sit on top. The acceptance rate hovers around 53%, which means half the candidates who attempt it don't submit a working solution. This isn't a straightforward simulation. Most people start by iterating bottom-up and fail because they can't efficiently track which configurations remain valid at each level. If this problem hits your live assessment and the pyramid logic confuses you, StealthCoder runs invisibly and surfaces a working solution in seconds, so you move on without losing time to dead ends.
Companies that ask "Pyramid Transition Matrix"
Pyramid Transition Matrix 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 an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.
Get StealthCoderThe trick is to recognize this as a constraint satisfaction problem solvable with backtracking and memoization, not a greedy simulation. You start at the bottom layer and try to build upward, but at each step you must check if the next block placement is legal given the transition matrix. Most candidates waste time re-computing valid transitions repeatedly. The pattern is to use DFS with Bit Manipulation to represent block states and prune branches early, or BFS to explore all possible pyramid configurations level by level. The matrix acts as a lookup for which top-block is valid given two adjacent lower blocks. If you haven't seen this pattern before, the mental leap from 'can I place this block' to 'is there a valid path through all layers' is real. StealthCoder hedges this by surfacing the backtracking template and bit-state encoding so you can code it under pressure without rederiving the approach.
Pattern tags
You know the problem.
Make sure you actually pass it.
Pyramid Transition Matrix 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 an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Pyramid Transition Matrix interview FAQ
Is Pyramid Transition Matrix still asked in real Airbnb interviews?+
Yes. Airbnb has it on their problem list. The acceptance rate is roughly 53%, so it's treated as a legitimate medium-difficulty bar. It's not a gimmick problem. It tests constraint satisfaction and backtracking under time pressure, which aligns with systems thinking at that company.
What's the core trick I'm missing if my brute-force approach times out?+
You're likely re-computing which blocks can sit on top of each pair. Use Bit Manipulation to encode valid top-blocks for each pair as a bitmask, then DFS upward. Memoize on layer and block state to avoid exploring the same configuration twice. This collapses exponential time to polynomial.
Does this problem require both DFS and BFS, or is one enough?+
DFS with backtracking is the most common solution. BFS can work if you model each layer as a state and explore all valid next layers. The input topics list both because different implementations exist, but DFS plus memoization is the tighter fit for this constraint satisfaction flavor.
How does Bit Manipulation actually help here?+
Represent the set of valid blocks for each position as a single integer bitmask. If the transition matrix says blocks A and B can support block C, set bit C in the bitmask for that position. Then iterate and compute the next layer's bitmasks from the current layer in O(n) instead of repeated lookups.
If I hit this problem in a live OA and forget the backtracking pattern, what do I do?+
StealthCoder runs invisibly during screen share and reads the problem, then surfaces a working backtracking template with memoization keyed to layer and state. You can code it from the solution without the proctor seeing the helper, so you don't lose 20 minutes to a false start.
Want the actual problem statement? View "Pyramid Transition Matrix" on LeetCode →