Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1. set(key, value) - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.
Software Development Engineer Interview Questions
32,819 software development engineer interview questions shared by candidates
Convert a sorted binary array of int to balanced BST.
Given a parking lot of fixed size, made up of a number of rows of spaces, and different vehicle sizes (e.g. car = 1 spot, bike = 1/2 spot, van = 2 spots, bus = 4 spots), develop an algorithm to determine the optimal place to park for any entering vehicle.
Given a continuous stream of cartesian points (x,y), find the 100 closest points to the origin.
Longest Palindromic Substring Most Frequent Words Binary Level Order Traversal Maximum profit from cutting rod LRU Cache
Both of the questions are not difficult but I didn't figure out the latter, so you should write down the code instead of just the pseudo-code.
Finding out if a linkedlist has a loop or not. Mergin two sorted linkedlists.
Find top 10 occurring words in a page.
What are the differences between C and Java? What would you describe as the defining characteristics of an object-oriented language?
Reverse a linked list.
Viewing 501 - 510 interview questions