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… Read More »
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… Read More »
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… Read More »
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… Read More »
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?
IF You have 5 unbreakable light bulbs and a 80 floor building. Using fewest possible drops, determine how much of an impact this type of light bulb can withstand? Can it withstand a drop from 20th floor, but breaks from the 22th?
Implement a function to return a ratio from a double function (0.25 -> 1/4). If the function tolerance is .01 then Find Ratio(.24, .01) -> 1/4