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.
Software Engineer 2 Interview Questions
665,666 software engineer 2 interview questions shared by candidates
efficiently search for an input word in an unbounded dictionary.
What kind of data structure would you use to index annagrams of words? e.g. if there exists the word "top" in the database, the query for "pot" should list that...
You are given a random binary tree 5 / \ 4 9 / \ / \ 3 5 6 8 Write code to print it out in order level ie 5 4 9 3 5 6 8 The tree need not be balanced. Write all the datastructures for the tree and make sure that you print newlines after each level. Also write test cases to test your code.
How would you store 1 million phone numbers?
I am playing a card game called 24. Cards ace to king are numbered 1 to 13. During a given round, I am provided four cards to play with from the shuffled pack. If the numbers from the four cards result in 24 then I win the round if I shout '24' first. How would you code a function for this?
Do you need to use the restroom?
Given a restaurant menu and a budget, output all the possible ways to use up the budget.
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.
Viewing 1421 - 1430 interview questions