We are given a Binary Tree, Print the Right view of Binary tree,
Right view of binary tree is : List of all nodes which are visible If you look at Binary tree from right … Read More
Microsoft Interview Questions
Find Nearest Minimum number in left side in O(n)
Given an array of integers, find the nearest smaller number for every element such that the smaller element is on left side.
Examples:
Input: arr[] = {1, 6, 4, 10, 2, 5} Output: {-1, 1,… Read More
Microsoft BING Interview Experience
Hi Today I want to share my Microsoft’s Interview Experience with BING Team, Hyderabd India.
Round 1 : Written Test
HackerEarth 2 Questions, Simple algorithm but complex to handle input, conversion etc, better to practice … Read More
Find position of the only set bit
FizzBuzz Solution C C++
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples … Read More
Convert Decimal to Roman numbers / Romanizer HackerEarth Code
Set of Numbers are given to you.
convert them to Roman numbers.
Solution is in Hacker Earth style… Read More
Stock Buy Sell to Maximize Profit
Stock Price on each day is given in an array.
Example : [ 10, 12, 7, 5, 9, 15, 13, 18 ]
Find the max profit that you can make by buying and selling in … Read More
Maximum difference between two elements s.t larger element appears after the smaller number
Find maximum profit if you can buy & sell share just once.
Given an array of integers, find out the difference between any two elements such that larger element appears after the smaller number.
Examples: … Read More
Trie Dictionary
Trie also called prefix tree (as they can be searched by prefixes).
The term trie comes from retrieval.
In the example shown, keys are listed in the nodes and values below them. Each … Read More
‘N’ Story Building, with 1,2,3 steps how many ways can a person reach top of building.
A building has n steps. A person can take 1,2 or 3 steps. In how many ways can a person reach top of building.
In order to build logic, lets think from first step
If … Read More