is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
1) Construct a linked list of pages present in the cache such that the "least recently used" page will always be at end and the "most recently used" page will always be in front of the list. Each node of the list contains the page number and it's address in the cache.
- EOF June 13, 20132) Construct a "height balanced" binary search tree (like AVL tree). Each node of the tree will store the page number and the address of corresponding node of the linked list.
FOR EACH REQUEST: Search the page number in the tree (O(log n)).
=> If the page is present in the list then delete this node from the list and insert it in front of the list (O(1)).
=> If page is not present then load it from memory and insert it front of the list (O(1)). Insert corresponding node in the tree (O(log n)).
=> If the list is full then delete the last node from the list (O(1)) and the corresponding node from the tree (O(log n)).
NOTE that we can also perform all the operations in constant average time using HashMaps.