1. Given 1 billion numbers, find 100 largest numbers 2. Prefix notation +*123 = 5
Software Engineer 2 Interview Questions
665,666 software engineer 2 interview questions shared by candidates
How would you quickly find the kth smallest number in an unsorted array?
The first question is two find the largest and second largest value at each level of a binary tree. You don't need to return all values, just print out instead. the second question is to return a value in an array with the probability proportional to the weight of the value within the array. For example, in an array [4,5,6], return 4 with probability 4/15, 5 with 5/15 and 6 with 6/15. You are given a function that returns a random real number between 0 and 1
Given an input array like [1,2,3] and a target like 5, find all combinations of array that sum up to target. [2,3] and [3,2] counts for only 1 combination.
Write a function that finds the square root of a decimal number.
Given an integer, return all sequences of numbers that sum to it. (Example: 3 -> (1, 2), (2, 1), (1, 1, 1))
"Reverse" of the problem if finding k-th smallest element in a tree: I had to find k-th largest.
Implement a method 'find' that will find the starting index (zero based) where the second list occurs as a sub-list in the first list. It should return -1 if the sub-list cannot be found. Arguments are always given, not empty. Sample Input 1 list1 = (1, 2, 3) list2 = (2, 3) Sample Output 1 1 Explanation As second list (2, 3) is sub-list in first list (1, 2, 3) at index 1 Sample Input 2 list1 = (1, 2, 3) list2 = (3, 2) Sample Output 2 -1
Given the root of a binary tree and an integer targetSum, return all root-to-leaf paths where each path's sum equals targetSum.
given numbers 1 4 2 0 2 0, move all zeros to beginning using minimum sorting technique
Viewing 1341 - 1350 interview questions