A site for technical interview questions, brain teasers, puzzles, quizzles (whatever the heck those are) and other things that make you think!
Write code to serialize and deserialize a given binary tree.
How will you compute x^y such that it will work for floats and negative values?
How can you reverse a double linked list?
Can you find a pair in array that will sum up to particular number?
I met three dragons. One always tells the truth, other one always lies and the last one alternates between lie and truth.
Dragon 1: You may ask us one question, then you must guess which dragon is which
Dragon 2: He’s lying. You may get three questions
Dragon 3: Oh no. It’s definitely one question
An array of elements is given arr
arr is of length n
Right rotate array by k elements
Time complexity O(n) and space complexity O(1)
Sample Input:
arr = {1,2 ,3,4,5}
n = 5
k = 2
Output :
arr = {4,5,1,2,3}
It is raining at midnight – will we have sunny weather in 72 hours?
A half is a third of it. What is it?
When was the last year that looked the same upside down?
(1961)
A book costs $1 plus half its price. How much does it cost?