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

18 Jan 2013

I would use doubly link list

12

Anonymous

4 Apr 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

2 Oct 2011

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

1

Anonymous

26 May 2012

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

Anonymous

24 Jan 2013

Doubly linkedList

1

Anonymous

18 Aug 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

29 Dec 2012

Command Pattern