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.
Software Interview Questions
748,383 software interview questions shared by candidates
Given a decimal number, find the number of 1s in its binary representation? Follow up: Can u solve this in O(1) run time and O(1) space.
Animate a given element using JS across any given time frame
Write a function that finds the square root of a decimal number.
An operation "swap" means removing an element from the array and appending it at the back of the same array. Find the minimum number of "swaps" needed to sort that array. Eg :- 3124 Output: 2 (3124->1243->1234) How to do it less than O(n^2) ?
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.
The second ninja (coding) test was about event processing system using pulling model, which literally no one in the industry is using.
I received two questions. The first was print out all possible strings that a phone number can produce. For instance: 2 -> A,B,C and 3 -> D,E,F. So if the input is 23, then the output should be "AD, AE, AF, BD, etc.." The second question was if you had multiple points (x,y), find the n closest points to the origin (0,0).
Move all zeroes to end of array with minimum assignment operations
Viewing 1631 - 1640 interview questions