TripAdvisor
3.8 of 5 163 reviews
www.tripadvisor.com Newton, MA 1000 to 5000 Employees

TripAdvisor Software Engineer Interview Question

I interviewed in Newton, MA and was asked:
"How would you implement an LRU Cache (LRU - Least Recently Used). What would your data structure look like. This was also a whiteboard problem."
Tags: technical, data structures, programming, white board
Add Tags [?]
Answer Flag Question

Part of a Software Engineer Interview Review - one of 222 TripAdvisor Interview Reviews

Answers & Comments

0
of 0
votes
The answer is to use a LinkedHashMap or a similar data structure because it allows O(1) on all needed operations.
- Interview Candidate on Apr 27, 2012 Flag Response
0
of 0
votes
LinkedHashMap works only if an item is used only once, so you need to implement your own O(1) insertion, deletion and search that are tailored to LRU.
- anonymous on Aug 17, 2012 Flag Response

To comment on this question, Sign In with Facebook or Sign Up


Tags are like keywords that help categorize interview questions that have something in common.

Glassdoor is your free inside look at TripAdvisor interview questions and advice. All interview reviews posted anonymously by TripAdvisor employees and interview candidates.