Implement a LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support get and put operations in O(1) time.
Amazon is a global e-commerce and cloud computing giant, known for AWS, retail marketplace, and leadership principles-focused interviews.
6
Questions in database
Design and implement a data structure for Least Recently Used (LRU) cache. It should support get and put operations in O(1) time.
How does the event loop work in Node.js? Explain the different phases and how async operations are handled.
Explain the differences between var, let, and const in JavaScript. When would you use each one?
Given the head of a singly linked list, reverse the list and return the reversed list. Implement both iterative and recursive solutions.
Compare REST and GraphQL APIs. What are the pros and cons of each approach? When would you choose one over the other?
Compare cookies, localStorage, and sessionStorage. What are the use cases, limitations, and security considerations for each?