LeetCode Question · Oct 2019 · USA

Blanked in technical interview. What can I do? (Sokoban)

SWE Phone Screen Easy
18 upvotes 7,708 views 25 replies

Question Details

I recently found myself in a technical phone interview (2nd stage) and blanked when I got presented the question. Here is the question I got asked: Given a 2D grid cells with...

Full Details

I recently found myself in a technical phone interview (2nd stage) and blanked when I got presented the question.

Here is the question I got asked:

Given a 2D grid cells with walls. You can move up, down, left, right. These are walks.
There is a box in the cells. The box can be moved to an adjacent free cell by standing next to the box and then moving in the direction of the box. This is a push.
There is a target cell. You need to move the box to target cell.
Calculate the plan to move which minimizes the number of pushes.

Like:

###########
#T## . . . . . .#
# .# .# . .####
# . . . . B .#
#. ##### .#
# . . . . S .#
###########:

r = row;
c = column;
S: start point
B: box
. : empty cell
#: wall
T: target

I was able to make basic observations and sketch those in code:
- use breath first search to find the shortest path of box to target
- box can only be pushed if person can reach a cell next to the box that is aligned with the direction it wants to push to (push right, person has to be left of box, ..)
- box can only be pushed if there is no wall next to the box in the direction we want to push

My intuition:
Collect a number of "shortest paths" of the box to target and filter the feasbile ones with respect to if the person can make the pushes for this path, i.e. can access all cells it needs to access to make the pushes for each path.

My brute force:
Calculate the path from the current cell to the cell where I am going to push from next. The algorithm becomes complex in time, the interviewer wanted me to find something more efficient.

Optimization (attempt):
I sketched a thought about finding cycles within the maze, this way the man can always reach a cell within that cycle independently of the location of the box and we don\'t have to recalculate if man can reach cell each BFS iteration.

Confusion:
Is this about mimizing the box path or the minizing the person\'s walk? The interviewer said both matters. I could not clarify further.

The interviewer gave a hint: "focus on the person instead of the box".

I have been practicing (training really) for my technical interviews throughout the last 3-4 months, I did ~250 leet code questions (72 easy, 132 medium, 51 hard). What can I do to
a) not blank (blank less)
b) to handle the situation when I don\'t know an answer better

What am I missing to pass this specific interview and what can I do about it?

UPDATE:
The interviewer explained a solution at the end of the interview which included something along the lines of storing the position of the box along with the person position on each BFS iteration and he also said something about a priority-queue but I unfortunately could not follow him.

In hindsight, I feel this interview suffered from poor communication between the two of us:
- From the beginning I was not able to clarify what is the target of the question "Calculate the plan to move which minimizes the number of pushes.". What exactly is a plan?
- The interviewer seemed to cut me off when I tried to explain and elaborate on a brute force solution (BFS with checks if the person can reach required cells)
- The hint from the interviewer "focus on the person" did not trigger any new observations in me

And the interview hit a blind spot of mine:
- Dijkstra\'s algorithm. I haven\'t found many algorithms on leetcode that required Dijkstra so I did not study it since I have been out of school. I will quickly close that gap and also look into A* search.

In retrospective I wish I would have given a detailed analysis of all the things I know and all the problems that I see and get really detailed on it. Pushing through on talking about the brute force solution and all possible optimizations in detail would have helped with that.

Free preview — 6 questions shown. Unlock all Intuit questions →

About This Question

This is a reported interview question from a intuit interview for a swe role during the phone screen round reported in 2019.

It covers the following topics: Graph, Heap, Matrix, Queue, Stack .

Difficulty rating: Easy

About Intuit Interview Reports

This question was reported by a candidate who interviewed at Intuit. LeakCode aggregates interview reports from 10+ sources, including 1Point3Acres, Glassdoor, LeetCode Discuss, Blind, Reddit, Indeed, and Nowcoder. Each report is translated where necessary, deduplicated against existing entries, and tagged by company, role, round type, and reporting date.

Use this question as one calibration data point, not a memorization target. Companies typically rotate their question pools every 2-4 months; the exact wording of a 2024 question may differ from what you encounter today. The underlying pattern, difficulty level, and follow-up depth at Intuit are the higher-signal extractions to take from this report.

For broader preparation context, the Intuit interview process typically includes a recruiter screen, one or two technical phone screens, and a 4-5 round on-site loop covering coding, system design (at L4+ levels), and behavioral. Reports tagged on LeakCode show the round-by-round distribution and typical difficulty calibration. To browse questions filtered by round type and seniority, use the company hub linked above.

How To Practice This Type of Question

Solve similar problems on LeetCode under timed conditions (25-35 minutes per medium difficulty). The goal is pattern recognition: recognize the underlying technique (sliding window, two-pointer, BFS, memoized recursion, etc.) within 60-90 seconds of reading. Strong candidates verbalize their hypothesis out loud before coding, then iterate based on feedback. Weak candidates dive into implementation immediately, lose time on the wrong approach, and run out of time for follow-ups.

Companies update their question pools every 2-4 months. The exact wording of any given question may have been retired by the time you interview. Focus your prep on the pattern, not the specific problem. The patterns that appear in Intuit reports consistently are the ones worth investing in; one-off niche problems are not.

During Your Intuit Round

Apply the standard interview round template: clarify requirements (2-3 minutes), state your approach out loud and confirm direction with the interviewer (3-5 minutes), code with narration (15-25 minutes), test with concrete examples including edge cases (5 minutes), discuss optimization or trade-offs if time permits (5 minutes). This template is universally accepted across FAANG and adjacent companies; deviating from it produces weaker interviewer feedback signal.

The single most predictive failure mode in Intuit reports tagged "no hire": not asking clarifying questions. Interviewers are explicitly trained to weight this. Strong candidates ask 3-5 clarifying questions even on problems that look obvious; weak candidates dive into code immediately. The clarifying-question check is often the first signal recorded in the interviewer's written notes.