Max completes his journey at an average speed of 9 km/h. He covers the first 9 km at a speed of 6 km/h and he… Read More

All Medium Articles

I recently had interviews with Amazon at Hyderabad for SDE 1. I had around 1 year and 9 months of experience. Telephonic Interview : It… Read More

What is the chromatic number of the following graph? (A) 2 (B) 3 (C) 4 (D) 5 Answer: (B) Explanation: The chromatic number of a… Read More

I recently attended an interview at Microsoft. Following was my experience: Round 1: This was a written round. Everyone was given the following two questions:… Read More

A hard disk system has the following parameters : Number of tracks = 500 Number of sectors/track = 100 Number of bytes /sector = 500… Read More

Consider the program below in a hypothetical language which allows global variable and a choice of call by reference or call by value methods of… Read More

When searching for the key value 60 in a binary search tree, nodes containing the key values 10, 20, 40, 50, 70 80, 90 are… Read More

The minimum positive integer p such that 3p modulo 17 = 1 is (A) 5 (B) 8 (C) 12 (D) 16 Answer: (D) Explanation: Either… Read More

Consider lines of slope -1 passing between nodes. Given a Binary Tree, print all diagonal elements in a binary tree belonging to the same line.… Read More

An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array is 0.… Read More

Note: This post contains codes that cannot be run using an online compiler. Please make sure that you have Python 2.7 and cv2 module installed… Read More

Given a Binary Tree (BT), convert it to a Doubly Linked List(DLL) In-Place. The left and right pointers in nodes are to be used as… Read More

The following is the explanation to the C++ code to blur an Image in C++ using the tool OpenCV. Things to know: (1) The code… Read More

Given a graph, a source vertex in the graph and a number k, find if there is a simple path (without any cycle) starting from… Read More

I was recently interviewed by Amazon, Bangalore for SDE position. It was an off campus drive in Delhi for TRMS team. Written Test : Q1)… Read More

Samuel covers the distance from his home to his office at a speed of 25 km/hr and comes back at a speed of 4 km/hr.… Read More

As always we will learn this pattern by defining a problem and using strategy pattern to solve it. Suppose we are building a game “Street… Read More

We strongly recommend to refer below post as a prerequisite for this. Branch and Bound | Set 1 (Introduction with 0/1 Knapsack) We discussed different… Read More

Given a number n, count number of n length strings with consecutive 1’s in them. Examples: Input : n = 2 Output : 1 There… Read More