Monthly Archives: January 2012
Find the squareroot of a given number rounded down to the nearest integer, without using the sqrt function. For example, squareroot of a number between [9, 15] should return 3, and [16, 24] should be 4.
Given the root of a binary search tree and 2 numbers min and max, trim the tree such that all the numbers in the new tree are between min and max (inclusive). The resulting tree should still be a valid binary … Continue reading
Welcome to my ‘how to implement a search engine’ series. I describe how to implement an actual search engine with working code in python. Here you can find pointers to original detailed articles. I will continue to share in this … Continue reading
The complete list of all my programming interview question articles with pointers to original posts. There are 28 questions in total, and since 28 is a perfect number (as Donald Knuth also mentioned) I decided that’s a good place to stop.
Remove duplicate characters in a given string keeping only the first occurrences. For example, if the input is ‘tree traversal’ the output will be ‘tre avsl’.
Given a number, find the next higher number using only the digits in the given number. For example if the given number is 1234, next higher number with same digits is 1243.