Find number of ones in an integer.
Engineers Interview Questions
898,729 engineers interview questions shared by candidates
You have 8 pennies, 7 weight the same, one weighs less. you also have a judges scale. Find the one that weighs less in less than 3 steps.
Determine if an array from 1..n has a duplicate in constant time and space.
Write a function(int[]) -> int that returns the lowest unassigned integer. For example [] -> 1 (empty set), [1] -> 2, [5, 3, 1] -> 2. Basically just sort the array, iterate, and compare current and previous. If there is a gap then that's your number.
The first question he gave me was not hard. 1. You call to someone's house and asked if they have two children. The answer happens to be yes. Then you ask if one of their children is a boy. The answer happens to be yes again. What's the probability that the second child is a boy? 2. (Much harder) You call to someone's house and asked if they have two children. The answer happens to be yes. Then you ask if one of their children's name a William. The answer happens to be yes again.(We assume William is a boy's name, and that it's possible that both children are Williams) What's the probability that the second child is a boy?
How do you determine if the light switch works in a refrigerator with the door closed?
If you have an unsorted array of numbers from 1-100, except 1 of those numbers is missing, how do you determine which number is missing
given a list of tuples of movie watched times, find how many unique minutes of the movie did the viewer watch e.g. [(0,15),(10,25)]. The viewer watched 25 minutes of the movie.
Print a binary tree by vertical level order like 1 2 4 3 5 print : 3 2 1 5 4
Viewing 111 - 120 interview questions