A site for technical interview questions, brain teasers, puzzles, quizzles (whatever the heck those are) and other things that make you think!
What’s the most difficult bug you’ve encountered, and how did you fix it?
shouldAllowRequest() that returns true if the incoming requests have arrived at a rate less than or equal to specified rate, false otherwise.
1. What if you don’t have to worry about bursts?
2. What if you want to handle burst?
Given a string consisting of only 0, 1, A, B, C where
A = AND
B = OR
C = XOR
Calculate the value of the string assuming no order of precedence and evaluation is done from left to right.
Examples:
Input :
1A0B1
Output : 1
1 AND 0 OR 1 = 1
Input :
2
1C1B1B0A0
1A0B1
Output :
0
1
How will you print all permutations of characters in a string?
Write a function to find the longest palindrome in a string.
You need to a number of floors in a building. There are 68 floors (numbered 1 to 64).
Conditions:
1. Can’t buy floors which numbers are prime.
2. Cannot buy floors which number contains a prime digit.
3. Can’t buy floor number 1.
4. Distance between all purchased floors must be different (i.e. you can’t buy floors 4, 6, and 8 because they both have 1 floor between them).
5. Distance between all purchased floors must be prime.
Using code or pseudocode figure out:
1. Maximum number of floors you can buy using conditions 1, 2 and 3?
2. Maximum number of floors you can buy using all conditions?
Missing Country Code
Imagine you get a data set from a client that contains addresses from 150 countries all around the world and your task is to verify them, the data is stored in 4 fields – Address Line 1, Address Line 2, City, ZIP code. What you also have available is address verification solution for each country, but the data set does not include the country code. How would you design the logic that would process the data and use the verification components in the most efficient way?
Hint: Running all of those 150 address verification components against each record is not considered efficient.
A man has to buy 7 floors in a building. Numbered floor 1 to 68.
Conditions:
1. He cannot buy floors with prime number.
2. He cannot buy floor number containing prime digit.
3. Floor number 1 is reserved for services.
4. Difference between all remaining floors shoud be different.
5. Difference between all remaing floors should not be prime.
Q1. From 1,2,3 options how many floors are legal.
Q2. From all options how many floors are legal.
You have 100 doors to be painted and 2 painters. 1 starts at one end and paints every other door. The other painter starts at the other end and paints every 3rd door. What door number will they meet at?