eBay Interview Question

Questions related to data structures like "What data structure would you use for a browser's BACK & FORWARD ability"

Interview Answers

Anonymous

Jan 18, 2013

I would use doubly link list

12

Anonymous

Apr 4, 2013

Use two stacks. Every time you visit a site, push its address in stack1. When you press back, pop from stack1 and also push in stack2. When user presses forward, pop from stack2 and also push in stack1.

3

Anonymous

Oct 2, 2011

May be Stack , any one please correct me if I am wrong.

1

Anonymous

May 26, 2012

This can be implemented by using two different stacks, one for back and one for forward.

Anonymous

Jan 24, 2013

Doubly linkedList

1

Anonymous

Aug 18, 2019

two stacks. When you visit a site, push its address into stack1 and clear stack2; When you press back, pop the address from stack1 and push the same address into stack2; When you press forward, pop the address from stack2 and push the same address into stack1.

Anonymous

Dec 29, 2012

Command Pattern