Design Browser History
A medium-tier problem at 78% community acceptance, tagged with Array, Linked List, Stack. Reported in interviews at Roblox and 4 others.
Design Browser History is a medium-difficulty problem that shows up in OAs at Roblox, Splunk, Snap, Cisco, and DoorDash. You're building a data structure that mimics browser back/forward navigation: track history, jump between pages, and handle the constraint that going back then forward erases future history. It looks simple until you code it and realize the naive approach either wastes memory or tanks on repeated queries. About 78% of candidates pass it, but that includes those who nail it on first try and those who stumble on the design choice. If this problem hits your live OA and you blank on the optimal structure, StealthCoder surfaces a working solution in seconds, invisible to the proctor.
Companies that ask "Design Browser History"
Design Browser History 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 trap is treating this like a standard list or tree. You need something that lets you move forward and backward in constant time while discarding the future when you visit a new page. A doubly-linked list with two pointers (current position and history end) solves it cleanly. Alternatively, two stacks (past and future) work equally well and are easier to reason about under pressure. The trick most candidates miss: when you visit a new URL after going back, you have to purge everything after your current position. That's the moment the problem stops feeling like a navigation exercise and becomes a state-management puzzle. Build this wrong and you'll either double-count pages or fail the erasure logic. Stack-based solutions are faster to code correctly in an interview. StealthCoder's edge here is recognizing the stack pattern and handling the erasure edge case before you've spent 20 minutes debugging a hybrid approach.
Pattern tags
You know the problem.
Make sure you actually pass it.
Design Browser History 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.
Design Browser History interview FAQ
How do I know whether to use a linked list or stacks for this problem?+
Both work. Doubly-linked lists let you visualize the history chain, but stacks are cleaner for interviews: one stack for past URLs, one for future. You push/pop and avoid pointer management errors. Most candidates who ace this under time pressure use stacks. Pick whichever you can code faster without bugs.
What's the trick everyone misses?+
The future gets erased when you visit a new URL after going back. You can't just append to history; you have to clear the forward stack or everything after your current node. That logic isn't obvious from the problem statement and trips up candidates who think of it as a simple list walk.
Is this problem still asked at FAANG and top startups?+
Yes. Five major companies explicitly report asking it, and it appears in both intern and mid-level OA rotations. The 78% pass rate means it's not a filter; it's a profiling tool. Interviewers use it to see if you can design a clean stateful system under pressure.
How does Design Browser History relate to the Stack and Linked List topics?+
Stack handles the navigation (push current URL to past, pop to go back, manage future queue). Doubly-linked list is the alternative for storing the actual history chain. Knowing both lets you choose the right tool. Stack is usually the faster, cleaner choice in a live setting.
What's the time complexity I should aim for?+
All three operations (visit, back, forward) should be O(1). A stack-based solution hits this easily. If your approach requires searching or iterating the history on every call, you're on the wrong path. Constant time on each operation is the bar.
Want the actual problem statement? View "Design Browser History" on LeetCode →