## Median of Stream of Running Integers using STL

Given that integers are being read from a data stream. Find median of all the elements read so far starting from the first integer till… Read More »

## Queue based approach for first non-repeating character in a stream

Given a stream of characters and we have to find first non repeating character each time a character is inserted to the stream. Examples: Input… Read More »

## Sort a stack using a temporary stack

Given a stack of integers, sort it in ascending order using another temporary stack. Examples: Input : [34, 3, 31, 98, 92, 23] Output :… Read More »

## Find maximum possible stolen value from houses

There are n houses build in a line, each of which contains some value in it. A thief is going to steal the maximal value… Read More »

## Find duplicates under given constraints

A sorted array contains 6 different numbers, only 1 number is repeated five times. So there are total 10 numbers in array. Find the duplicate… Read More »

## Form coils in a matrix

Given a positive integer n that represents dimensions of a 4n x 4n matrix with values from 1 to n filled from left to right… Read More »

## Three way partitioning of an array around a given range

Given an array and a range [lowVal, highVal], partition the array around the range such that array is divided in three parts. 1) All elements… Read More »

## Boggle | Set 2 (Using Trie)

Given a dictionary, a method to do lookup in dictionary and a M x N board where every cell has one character. Find all possible… Read More »

## Find two prime numbers with given sum

Given an even number (greater than 2 ), print two prime numbers whose sum will be equal to given number. There may be several combinations… Read More »

## Largest palindrome which is product of two n-digit numbers

Given a value n, find out the largest palindrome number which is product of two n digit numbers. Examples : Input : n = 2… Read More »

## Find Surpasser Count of each element in array

A surpasser of an element of an array is a greater element to its right, therefore x[j] is a surpasser of x[i] if i <… Read More »

## Yahoo Interview Experience | Set 4 (On-Campus for System Engineer)

Job Profile : System Engineer (on Campus) Round-1: Pen and paper test was conducted.There were about 30 MCQ’s. 4 aptitude and 26 technical questions.Technical questions… Read More »

## Sort a stack using recursion

Given a stack, sort it using recursion. Use of any loop constructs like while, for..etc is not allowed. We can only use the following ADT… Read More »

## Puzzle 3 | (Calculate total distance travelled by bee)

Two trains are on same track and they are coming toward each other. The speed of first train is 50 KMs/h and the speed of… Read More »

## Serialize and Deserialize a Binary Tree

Serialization is to store tree in a file so that it can be later restored. The structure of tree must be maintained. Deserialization is reading… Read More »