Implement data structure "Map" storing pairs of integers (key, value) and define following member functions in O(1) runtime: void insert(key, value), void delete(key), int get(key), int getRandomKey().
Software Engineers Interview Questions
420,103 software engineers interview questions shared by candidates
Write a code to construct a tree. It should get a string and generate related tree.
Compare 2 different strings which only differ in one bit, and analyze the time and space complexity of your algorithms. Follow up: two strings are very long so that we do not have enough space for the hashmap.
Return k smallest element in a tree
given rand5() that return 1-5 uniformly produce rand7() that returns 1-7 uniformly
Given a restaurant menu and a budget, output all the possible ways to use up the budget.
You have a sentence with several words with spaces remove and words having their character order shuffled. You have a dictionary. Write an algorithm to produce the sentence back with spaces and words with normal character order.
Given a binary tree, print out the whole tree by levels
Do you need to use the restroom?
Find and return the first duplicate integer in an array in O(n) time and O(1) space. Assume there will always be at least one duplicated integer in the array.
Viewing 1241 - 1250 interview questions