All Articles

Levels: Easy Medium Expert

Dynamic Programming

28 Dynamic programming – Printer Problem Expert
27 Dynamic Programming – Egg Dropping Problem Expert
26 Dynamic programming – Minimum Jumps to reach to end Expert
25 Dynamic programming — Remove Boxes Problem Expert
24 Dynamic Programming — Find longest Snake sequence in a given matrix Medium
23 Maximum difference between two elements where larger element appears after the smaller element Medium
22 Dynamic Programming — Count all paths in 2D Matrix with Obstructions in it Medium
21 Dynamic Programming — Edit Distance Problem Medium
20 Dynamic Programming — Coin In a Line Game Problem Medium
19 Dynamic Programming — Box Stacking Problem Medium
18 Dynamic Programming — Split the String into Minimum number of Palindromes Medium
17 Dynamic Programming — Highway Billboard Problem Medium
16 Dynamic Programming — Maximum Subarray Problem Medium
15 Dynamic Programming — Longest Palindromic Subsequence Medium
14 Dynamic Programming — Maximum Product Cutting Problem Medium
13 Dynamic Programming — Minimum Numbers are Required Whose Square Sum is Equal To a Given Number Expert
12 Dynamic Programming — Longest Common Substring Expert
11 Dynamic Programming — Coin Change Problem Easy
10 Dynamic Programming — Minimum Cost Path Problem Easy
9 Dynamic Programming — Longest Common Subsequence Medium
8 Dynamic Programming — Rod Cutting Problem Medium
7 Dynamic Programming —The Word Break Problem Expert
6 Dynamic Programming — Subset Sum Problem Expert
5 Dynamic Programming — Maximum size square sub-matrix with all 1s Medium
4 Dynamic Programming — Longest Increasing Subsequence Medium
3 Dynamic Programming — Stairs Climbing Puzzle Easy
2 Dynamic Programming — Minimum Coin Change Problem Medium
1 Introduction To Dynamic Programming — Fibonacci Series
Easy

Backtracking

9 The Word Break Problem Expert
8 Print All The Permutations Of a String Expert
7 Knight’s Tour Problem Expert
6 Search a Word In a Matrix Expert
5 N Queens Problem — Better Solution Expert
4 N Queens Problem Expert
3 Rat In A Maze Puzzle Expert
2 SUDOKU Solver Expert
1 Introduction To Backtracking Programming Easy

Threaded Binary Tree

4 Convert Binary Tree into Threaded Binary Tree Expert
3 Double Threaded Binary Tree Complete Implementation Expert
2 Single Threaded Binary Tree Complete Implementation Expert
1 Introduction to Threaded Binary Tree Medium

Trees/ Binary Tree/ Binary Search Tree

72 Convert BST to Greater Sum Tree Medium
71 Get the Sum of all left leaves in a Binary tree Easy
70 Convert binary tree to its Sum tree Medium
69 Binary Tree-Postorder Traversal — Non Recursive Approach Easy
68 Binary Tree — Preorder Traversal — Non Recursive Approach Easy
67 Binary Tree-Inorder Traversal — Non Recursive Approach Easy
66 Delete the Binary Tree Easy
65 Search the Element in a binary tree — With and Without Recursion Easy
64 Tree Traversals Easy
63 Find the Size of a Binary Tree without Recursion Easy
62 Merge K Sorted Arrays Expert
61 Breadth-First Search/Traversal in a Binary Tree Easy
60 Diameter Of a Binary Tree Expert
59 Provide the Next Siblings Pointers in a Given Binary Tree Expert
58 Find the Deepest Left Node in a Binary Tree. Medium
57 Find the Max element in a Given Binary Tree Easy
56 Check If One Binary is Mirror Tree of another Binary Tree. Easy
55 Find If Path Exist in Binary Tree with Sum=X Medium
54 Reverse Level Order Traversal Medium
53 Find the Deepest Node in a Binary Tree. Medium
52 Find the Height of a tree without Recursion Medium
51 Print All The Full Nodes in a Binary Tree Medium
50 Binary Min — Max Heap Expert
49 Print the Bottom View of a Binary Tree Medium
48 AVL Tree — Insertion Expert
47 Construct a binary tree from given Inorder and Level Order Traversal Expert
46 Construct Binary Search Tree from a given Preorder Traversal Using Stack (Without Recursion) Expert
45 Construct Binary Search Tree from a given Preorder Traversal using Recursion Expert
44 Print The Top View of a Binary Tree Medium
43 Construct a Binary Tree from Given Inorder and Depth-First-Search. Expert
42 Depth First Search/Traversal in Binary Tree Easy
41 Inorder Predecessor and Successor in Binary Search Tree Expert
40 Print All The Nodes Which are X distance from the Leaf Nodes Medium
39 Print All The Nodes Which are X distance from the Root Medium
38 Find the Distance between Two Nodes of a Binary Tree. Expert
37 Find The Distance From Root To Given Node of a Binary Tree. Medium
36 Construct a binary tree from given Inorder and Postorder Traversal Expert
35 Print the Vertical Sum in binary Tree . Medium
34 Print the Binary Tree in Vertical Order Path. Medium
33 Lowest Common Ancestor in a Binary Tree (Not Binary Search Tree). Expert
32 Lowest Common Ancestor in a Binary Search Tree. Medium
31 Make a Binary Tree from Given Inorder and Preorder Traveral. Expert
30 Given a binary tree, find out the maximum sum of value from root to each leaf. Medium
29 Reverse Alternate levels of a given Binary Tree. Medium
28 Given a Sorted Singly Linked List Array, Convert it into a Balanced Binary search Tree. Medium
27 Given a binary tree, Convert it into its Mirror Tree Easy
26 Given a binary tree, Print All the Nodes that don’t have Siblings. Easy
25 Convert a Sorted Doubly Linked List to Balanced BST. Medium
24 Given a binary tree, Find the Maximum Path Sum between Any Two Leaves Medium
23 Print Left View of a given binary tree Medium
22 Print Right View of a given binary tree Medium
21 In a Binary Tree, Check if Two nodes has the same parent or are siblings Medium
20 In a Binary Tree, Check if two nodes are Cousins Medium
19 Check if Two BST’s are Identical Easy
18 Print Paths from root to all leaf nodes in a binary tree. Medium
17 Print All Nodes Between Two Given Levels Medium
16 Find the maximum width of a binary tree Medium
15 Level Order Traversal in Zig Zag pattern OR Print in Spiral Pattern Expert
14 Determine whether given binary tree is binary search tree(BST) or not Medium
13 Find the Size of the Binary Tree Easy
12 Given two binary trees, check if one binary tree is a subtree of another Medium
11 Print a path from Root to Node in Binary Tree Medium
10 Inorder Successor in Binary Search Tree without Using Parent link Expert
9 Inorder Successor in Binary Search Tree Using Parent link Expert
8 Inorder Successor in Binary Tree Medium
7 Sorted Array to Binary Search Tree of Minimal Height Medium
6 In a Binary Tree, Create Linked Lists of all the nodes at each depth. Expert
5 Level Order Traversal, Print each level in separate line. Medium
4 Find whether if a Given Binary Tree is Balanced? Easy
3 Get the Height of a Node in a Binary Tree Easy
2 Find the Maximum Depth OR Height of a Binary Tree Easy
1 Binary Search Tree Complete Implementation. Easy

 

Linked List

26 Circular Linked List Complete Implementation Easy
25 Doubly Linked List Complete Implementation Easy
24 Implement Stack Using Linked List Easy
23 Reverse Alternative ‘k’ nodes in a Linked List. Medium
22 Swap Nodes in pairs in a Linked List by changing links Medium
21 Reverse a Linked List in groups of given size ‘K’ Medium
20 Reverse The Doubly Linked List Medium
19 Swap Kth Node from the front with the Kth Node from the End Medium
18 Delete X Nodes After Y Nodes In a Linked List Easy
17 Merge Sort in a Linked list Medium
16 Merge a Linked list into another Linked List at Alternate Positions. Medium
15 Given a Sorted Singly Linked List Array, Convert it into a Balanced Binary search Tree. Medium
14 Convert a Sorted Doubly Linked List to Balanced BST. Medium
13 In a Binary Tree, Create Linked Lists of all the nodes at each depth. Expert
12 Add two numbers represented by a linked list, Numbers are Stored in FORWARD order Medium
11 Add two numbers represented by a linked list, Numbers are Stored in REVERSE order Medium
10 Reverse a Linked List — Part 2 Easy
9 Swap Every Kth Node in a LinkedList Medium
8 Delete a Node in the Middle of a linked list, Given only access to that Node Easy
7 To find the kth to Last Element of a Singly Linked List Easy
6 Remove Duplicates from an Unsorted Linked list Easy
5 Find Intersection Point in Two Linked List Medium
4 Find the Loop in a Linked list, find its length and Break the Loop Medium
3 Reverse a Linked List Easy
2 Merge or Combine Two Sorted Linked Lists Medium
1 Singly Linked List Implementation Easy

Arrays

91 Nuts & Bolts Problem (Lock & Key problem) Easy
91 Divide and Conquer – Rearrange array elements in special order Medium
90 Remove the duplicates from the given String Medium
89 Find median of two sorted arrays of same size Medium
88 Find two non-repeating numbers in an array in O(n) time and O(1) space Expert
87 Separate even and odd integers in a given array Easy
86 Find three elements in an array that sum to a zero Easy
85 All elements appears thrice and one element appears once. Find that element in O(n) time and O(1) space Expert
84 Separate 0’s and 1’s in a given array Easy
83 Find local minimum or local maximum in O(1) Medium
82 Find three elements in an array that sum to a given value Easy
81 Majority Element– Boyer–Moore majority vote algorithm Medium
80 Majority Element – Part 1 Easy
79 Find the local minima in a given array Medium
78 Check if array is sorted using recursion Easy
77 Find the Index from which 0 starts Easy
76 Find the increasing OR decreasing point in an array Easy
75 Find the only element in array which appears only once Easy
74 Stock Single Sell Problem — O(n) Solution Expert
73 Maximum Subarray OR Largest Sum Contiguous Subarray Problem – Divide and Conquer Medium
72 Maximum difference between two elements where larger element appears after the smaller element Medium
71 Find the two repeating elements in a given array | 6 Approaches Medium
70 Find two elements whose sum is closest to zero Medium
69 Find the element which appears maximum number of times in the array. Medium
68 Find duplicates in an given array in O(n) time and O(1) extra space Easy
67 Find the last non repeating character in a given string Easy
66 Find the last repeating character in a given string Easy
65 Find the first non repeating character in a given string Easy
64 Find the first repeating character in a given string Easy
63 Find longest Snake sequence in a given matrix Medium
62 Count all paths in 2D Matrix with Obstructions in it Medium
61 Count all paths from top left to bottom right of a mXn matrix Medium
60 Reverse the given Array without using built in function Easy
59 Print All Diagonals of a given matrix Medium
58 Kadane’s Algorithm — Maximum Subarray Problem Medium
57 Shortest Range in K-sorted Lists Expert
56 Generate Maximum revenue by selling K tickets from N windows Medium
55 Print All Possible Subsets with Sum equal to a given Number Expert
55 Print All N Length Strings from Given Number K Expert
54 Generate Well Ordered Passwords of a Given Length K Medium
53 All N Length Strings from Given String of Length K Expert
52 Find the Kth Smallest/Largest Element in an Array Easy
51 Priority Queue Implementation Easy
50 Merge K Sorted Arrays Expert
49 Find a Missing Number From a Sequence of Consecutive Numbers | XOR
Method
Easy
48 Rearrange the Array of Given Range N, such that A[i]=i Medium
47 Find a Number occurring odd number of times in a Given array Easy
46 Binary Min — Max Heap Expert
45 Magic Index — Find Index In Sorted Array Such That A[i] = i. Easy
44 Print All Combinations of subset of size K from Given Array Medium
43 Print All the Subsets of a Given Set (Power Set) Expert
42 Construct a Special Triangle from a Given Array Easy
41 Find Increasing Triplet Sub-sequence Medium
40 Track the Maximum Element in a Stack. Medium
39 Print All Possible Valid Combinations Of Parenthesis of Given ‘N’ Expert
38 Counting Sort Medium
37 Towers Of Hanoi Easy
36 Find The Missing Duplicate in a Given Array. Easy
35 Sort 3 Integers without using if condition OR use only Max() function. Easy
34 Euclidean algorithm — Greatest Common Divisor(GCD) Easy
33 Implement Queue Using Stacks Easy
32 Depth First Search/Traversal in Binary Tree Medium
31 Check if Array is Consecutive Integers Easy
30 In an Array, find the Contiguous Subarray with Sum to a Given Value. Medium
29 In an Array, find the Smallest Subarray with Sum Greater than the Given Value Easy
28 Rearrange Positive and Negative Elements at Alternate Positions in an Array In O(1) Extra Space Expert
27 Find intersection between Two Sorted Arrays. Easy
26 Find Kth Smallest or Largest element in an Array. Medium
25 Given an array arrA[], find the maximum j – i such that arr[j] > arr[i]. Medium
24 Find All Elements in an Array which appears more than N/K times, N is Array Size and k is a Number. Expert
23 Search an Element in a Rotated Sorted Array Medium
22 Print All The Permutations Of a String Expert
21 Sort an Given Array in the order defined by another array Medium
20 Sort an Array such that the odd numbers appear first followed by the even numbers . The odd numbers in ascending order and the even numbers in descending order. Medium
19 Find the number of occurrences of a number in a given sorted array. Medium
18 Find all common numbers in given three sorted arrays. Easy
17 Find the first repeated element in an array by its index Medium
16 Minimum number that cannot be formed by any subset of an array Easy
15 Sorted Array to Binary Search Tree of Minimal Height Medium
14 Count All Paths from Top left to bottom right in Two Dimensional Array including Diagonal Paths Medium
13 Print All Paths from Top left to bottom right in Two Dimensional Array Medium
12 Rearrange Positive and Negative Numbers of Array On Each Side in O(nlogn) Expert
11 Find The Longest Sequence Of Prefix Shared By All The Words In A String Expert
10 Print All Elements of Two Dimensional Array in Spiral Medium
9 Given an array and a number k, check for pair in array with sum as k in O(nlgn) Easy
8 Quick Sort Implementation Medium
7 Find an Element in 2 dimensional sorted array Medium
6 Find Whether Given String is palindrome or Not. Easy
5 Find a peak element in a Given Array Easy
4 Find two Missing Numbers in a Sequence of Consecutive Numbers Easy
3 Find a Missing Number From a Sequence of Consecutive Numbers Easy
2 Merge Sort — Updated — Most Efficient ways to Implement Medium
1 Binary Search Easy

Strings

12 Text Justification Problem Easy
11 Sort Names by their Last Names. Easy
10 Print All Possible Valid Combinations Of Parenthesis of Given ‘N’ Expert
9 Generate All Strings of n bits. Medium
8 Print All The Permutations Of a String Expert
7 Check if one string is Rotation of another string Easy
6 String Compression using count of repeated characters — Run Length Encoding Easy
5 Replace all spaces in a String with ‘%20′ Medium
4 Find Whether Two Strings are Permutation of each other Medium
3 Find The Longest Sequence Of Prefix Shared By All The Words In A String Expert
2 Find Out Whether String Contains All The Unique Characters Easy
1 Find Whether Given Sequence of parentheses are well formed. Medium

Bit Manipulation

12 Number of bit to be flipped to convert one number to another. Easy
11 All elements appears thrice and one element appears once. Find that element in O(n) time and O(1) space Expert
10 Find the only element in array which appears only once Easy
9 Reverse the binary representation of a number. Medium
8 Find The Missing Duplicate in a Given Array Easy
7 Generate All Strings of n bits. Medium
6 Find a Missing Number From a Sequence of Consecutive Numbers | XOR Method Easy
5 Find a Number occurring odd number of times in a Given array Easy
4 Find the right most set bit of a number Easy
3 Find the two repeating elements in a given array | 6 Approaches Medium
2 Find the right most unset bit OR zero bit of a number Easy
1 Number of 1’s in bit representation of a number Easy

MISC

9 Check whether the given number is a perfect square Medium
8 Algorithm to calculate power(k,n) Medium
7 Find remainder without using modulo operator Easy
6 Swap two numbers without using extra variable Easy
5 Find numbers which are palindrome in both their decimal and octal Representations Easy
4 Colorful Numbers Expert
3 Goldbach’s Conjecture Easy
2 Convert Decimal into Irreducible Fraction Easy
1 Clock Angle Problem Easy

__________________________________________________
Top Companies Interview Questions..-

Google Microsoft Amazon Facebook more..

If you find anything incorrect or you feel that there is any better approach to solve the above problem, please write comment.
__________________________________________________

%d bloggers like this: