eBay Interview Question: Questions related to data str... | Glassdoor

Interview Question

Software Engineer Intern Interview San Jose, CA

Questions related to data structures like "What data

  structure would you use for a browser's BACK & FORWARD ability"

Interview Answer

6 Answers


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

KP on Oct 2, 2011

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

Anon on May 26, 2012

Command Pattern

Aditya on Dec 29, 2012

I would use doubly link list

Rahul on Jan 17, 2013

Doubly linkedList

Node on Jan 23, 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.

Ambo on Apr 4, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.