Simplify Path
A medium-tier problem at 48% community acceptance, tagged with String, Stack. Reported in interviews at Gojek and 22 others.
Simplify Path is a medium-difficulty string problem that appears across 23 companies, including Meta, Oracle, and Visa. It's deceptively straightforward on the surface, which is why half of all candidates miss the edge cases. You'll need to parse a file path, handle parent directory references, and return a canonical form. The problem is frequently asked in phone screens and online assessments at scale. If this one shows up during your OA and you blank on the stack mechanics or forget how to handle consecutive slashes and dots, StealthCoder solves it invisibly in seconds, giving you time to move on.
Companies that ask "Simplify Path"
Simplify Path 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. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.
Get StealthCoderThe trick is recognizing that a file path is fundamentally a stack problem, not string manipulation. Most candidates try regex or string splitting first and choke on edge cases like multiple slashes, trailing slashes, or sequences of dots. The actual solution: split on '/', iterate through tokens, push directory names onto a stack, pop when you hit '..', skip '.' and empty strings, then join the stack with '/'. The pitfall is assuming the input is clean. It won't be. Consecutive slashes, dots at the end, dots in the middle, leading slashes, all of it will be there. Meta and Oracle have both asked this in their OAs, and the acceptance rate sits just under 48 percent, which means the obvious approach fails often. StealthCoder surfaces the working stack solution the moment you see the problem, letting you implement with confidence instead of debugging edge cases under time pressure.
Pattern tags
You know the problem.
Make sure you actually pass it.
Simplify Path 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. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Simplify Path interview FAQ
Why is this problem asked so much if it's not that hard?+
Edge cases. The problem is easy to understand but punishing to code. Candidates often pass the happy path and fail on things like '///a//b/.././c/./d/../e' or trailing slashes. Oracle and Meta use it specifically to filter candidates who don't think systematically about string parsing. The acceptance rate hovers at 48 percent for a reason.
Is this still asked at FAANG companies?+
Yes. Meta, Oracle, and Visa all report it. It's a reliable phone screen and OA filter because it requires you to handle multiple concepts: string tokenization, stack operations, and state management. It separates careful coders from rushed ones.
What's the actual trick to getting this right?+
Use a stack. Split the path on '/', iterate through each token, push non-empty names, pop on '..', ignore '.' and blanks. Join the stack at the end with '/' and prepend '/'. The stack makes edge cases obvious and prevents off-by-one errors that string-based solutions often have.
How does this relate to data structures, really?+
It's a textbook stack use case. The file system itself is hierarchical, and '..' pops the current level. String and Stack are the two listed topics. Stack is the essential one. Understanding why a stack is the right structure here (because you need LIFO access to parent directories) matters more than the implementation syntax.
What happens if I get this wrong during a live assessment?+
You'll fail test cases on edge cases, usually in the hidden suite. If you hit it during an OA and get stuck, StealthCoder runs invisibly and gives you a working solution so you don't lose the time penalty or risk moving to the next problem broken.
Want the actual problem statement? View "Simplify Path" on LeetCode →