Given a collection of intervals, merge all overlapping intervals.

**Example 1: ** Input: [[2,6],[8,10],[15,18], [1,3]]

Output: [ [1,6] , [8,10] , [15,18] ]

Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6].

Interview Questions asked in Google, Microsoft, Amazon

Given a collection of intervals, merge all overlapping intervals.

**Example 1: ** Input: [[2,6],[8,10],[15,18], [1,3]]

Output: [ [1,6] , [8,10] , [15,18] ]

Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6].

Given a non-empty binary tree, find the maximum path sum.

For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child … Read More

by Dhaval Dave

Given a set T containing a list of integers and a sum S, does a subset of T exists whose sum is equal to S.

NOTE – Subset … Read More

by Dhaval Dave

Number Theory is used a lot for solving real world problems and for the same reason It’s asked most of the time in interviews. This article marks the beginning of series of articles over Number … Read More

by Dhaval Dave

**Knight Tour Problem** : Given a chess board of size n x n, initial position of knight and final position of knight. We need to find the minimum number of steps required to reach final … Read More

by Dhaval Dave

Consider a binary matrix as shown in the figure below. You need to find the maximum size of square sub matrix with all 1’s.

… Read Moreby Dhaval Dave

Given two strings x and y, What is the cheapest possible way to convert x into y where following operations are allowed to perform –

- Substitute a character c of x with c’.
- Insert

by Dhaval Dave

In a Binary Search Tree (BST), all keys in left subtree of a key must be smaller and all keys in right subtree must be greater. So a Binary Search Tree by definition has distinct … Read More

by Dhaval Dave

Given a string, find the minimum number of characters to be inserted to form Palindrome string out of given string

Before we go further, let us understand with few examples:

ab: Number of insertions required … Read More

by Dhaval Dave

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