Site Map

Difficulty Levels

Beginner Intermediate Expert


1 Graph 2 Dynamic programming
3 Strings 4 Binary Tree
5 Arrays 6 Linked List
7 Backtracking 8 Divide and Conquer
9 Numbers 10 Priority Queue
11 Recursion 12 Search
13 Pair 14 Deque
15 Sorting Techniques 16 Bit Manipulation Problems

Top Companies Interview Questions

1 Google 2 Microsoft
3 Amazon 4 Facebook
5 Adobe 6 Apache
7 Bloomberg 8 Epic Systems
9 Flipkart 10 Goldman Sachs
11 Groupon 12 LinkedIn
13 NetApp 14 NVIDIA
15 Oracle 16 Qualcomm
17 Twitter 18 Yahoo

All Problems

Djkstra’s – Shortest Path Algorithm (SPT)2018-06-20 11:08:44
Replace all vowels with next consonant in a given string2018-06-18 00:08:11
Find the Area of a Triangle Using coordinates2018-06-16 20:00:23
Java Program to find if Triangle can be formed using given 3 sides2018-06-16 14:08:18
Convert Number to base 3 String Representation2018-06-16 13:59:13
Find the Area of a Triangle Given Three Sides – Heron’s Formula2018-06-09 13:29:49
Find Factorial of a given Number2018-06-09 12:39:24
Check if two Strings are equal without using built-in function2018-06-09 12:18:15
Reverse a String using Recursion2018-06-09 12:10:26
Find Sum of all Digits of a Number2018-06-09 12:04:31
Print maximum occurring character in a String2018-06-09 00:37:38
Kruskal’s Algorithm – Minimum Spanning Tree (MST) – Complete Java Implementation2018-05-29 21:03:52
Introduction to Minimum Spanning Tree (MST)2018-05-17 00:04:11
Prim’s – Minimum Spanning Tree (MST) |using Adjacency List and Priority Queue without decrease key in O(ElogV)2018-05-15 20:19:52
Prim’s – Minimum Spanning Tree (MST) |using Adjacency List and Priority Queue with decrease key2018-05-13 15:56:05
Prim’s – Minimum Spanning Tree (MST) |using Adjacency List and Min Heap2018-05-07 19:47:49
Prim’s – Minimum Spanning Tree (MST) |using Adjacency Matrix2018-04-25 22:29:57
Prim’s Algorithm – Minimum Spanning Tree (MST)2018-04-21 21:40:54
Graph – Find Cycle in Undirected Graph using Disjoint Set (Union-Find)2018-04-15 13:23:01
Disjoint Set | Union-Find Algorithm – Union by rank and path compression2018-04-12 00:28:01
Disjoint Set Data Structure – Union Find Algorithm2018-04-07 23:27:03
Graph – Count all paths between source and destination2018-04-05 21:07:39
Graph – Find Number of non reachable vertices from a given vertex2018-04-02 20:19:14
Graph – Detect Cycle in a Directed Graph using colors2018-03-29 22:21:43
Graph – Detect Cycle in Undirected Graph using DFS2018-03-26 23:17:41
Graph – Detect Cycle in a Directed Graph2018-03-21 21:54:43
Graph – Software Installation Problem2018-03-18 19:54:38
Snake and Ladder Problem2018-03-14 21:14:11
Weighted Graph Implementation – JAVA2018-03-13 22:23:16
Graph – Depth First Search in Disconnected Graph2018-03-11 13:43:04
Topological Sort2018-03-06 22:16:05
Graph – Depth First Search using Recursion2018-03-04 10:13:52
Graph Implementation – Adjacency Matrix | Set 32018-03-01 22:51:52
Java Pair Class2018-02-25 20:43:10
Graph Implementation – Adjacency List – Better| Set 22018-02-22 22:30:55
Minimum Copy Paste Operations2018-02-17 18:39:55
Count and print all Subarrays with product less than K in O(n)2018-02-12 23:10:46
Sliding Window Algorithm (Track the maximum of each subarray of size k)2018-02-10 18:38:00
Deque Implementation – Java2018-02-08 22:29:57
Print all sub sequences of a given String2018-02-05 22:23:27
Graph – Print all paths between source and destination2018-02-04 13:48:30
Graph – Depth First Traversal2018-02-01 22:19:03
Print all sub sequences of a given array2018-01-28 22:34:36
Print all substrings of a given string2018-01-26 00:08:36
Sum of all sub arrays in O(n) Time2018-01-22 18:09:42
Print all subarrays of a given array2018-01-19 17:47:19
Text Justification Problem (OR Word Wrap Problem)2018-01-16 17:37:39
Dynamic Programming – Egg Dropping Problem2018-01-13 22:24:22
Nuts & Bolts Problem (Lock & Key problem)2018-01-10 20:29:28
Divide and Conquer – Rearrange array elements in special order2018-01-05 20:18:16
Dynamic programming – Printer Problem2018-01-01 12:57:02
Remove Duplicates from a string2017-12-28 19:12:11
Find median of two sorted arrays of same size2017-12-23 14:01:30
Dynamic programming – Minimum Jumps to reach to end2017-12-17 13:42:17
Dynamic programming – Remove Boxes Problem2017-12-03 14:02:46
Find two non-repeating numbers in an array in O(n) time and O(1) space2017-10-29 09:24:47
Number of bit to be flipped to convert one number to another.2017-09-14 20:51:42
Separate even and odd integers in a given array2017-09-12 22:20:38
Find three elements in an array that sum to a zero.2017-09-11 22:10:00
All elements appears thrice and one element appears once. Find that element in O(n) time and O(1) space2017-09-07 19:56:04
Separate 0’s and 1’s in a given array2017-09-05 22:14:03
Find local minimum or local maximum in O(1).2017-09-04 14:27:54
Find three elements in an array that sum to a given value2017-09-03 22:09:56
Majority Element- Boyer–Moore majority vote algorithm2017-09-01 19:31:15
Majority Element – Part 12017-09-01 19:23:38
Find the local minima in a given array2017-09-01 19:15:53
Check whether the given number is a perfect square2017-08-26 23:15:50
Check if array is sorted using recursion2017-08-26 23:07:00
Find the Index from which 0 starts2017-08-26 23:01:16
Find the increasing OR decreasing point in an array2017-08-26 22:51:47
Find the only element in array which appears only once2017-08-26 22:43:36
Algorithm to calculate power(k,n).2017-08-26 22:35:13
Find remainder without using modulo operator2017-08-26 22:27:31
Swap two numbers without using extra variable2017-08-26 22:21:01
Number of 1’s in bit representation of a number2017-08-26 17:23:17
Stock Single Sell Problem – O(n) Solution2017-08-26 17:12:14
Maximum Subarray OR Largest Sum Contiguous Subarray Problem – Divide and Conquer2017-08-26 16:59:09
Maximum difference between two elements where larger element appears after the smaller element2017-07-30 16:24:30
Find the right most unset bit OR zero bit of a number2017-07-30 16:16:12
Find the two repeating elements in a given array | 6 Approaches2017-07-24 19:07:06
Find the right most set bit of a number2017-07-23 14:39:04
Find two elements whose sum is closest to zero2017-07-09 18:50:31
Find the element which appears maximum number of times in the array.2017-06-26 20:06:29
Find duplicates in an given array in O(n) time and O(1) extra space.2017-06-18 12:08:44
Find the last non repeating character in a given string.2017-06-11 19:21:28
Find the last repeating character in a given string.2017-05-29 20:34:49
Find the first non repeating character in a given string2017-05-27 15:08:59
Find the first repeating character in a given string2017-03-08 00:09:32
K-Means Algorithm2017-03-02 21:56:54
k-Nearest Neighbors2016-12-30 00:01:34
Find longest Snake sequence in a given matrix2016-08-08 00:24:22
Dynamic Programming – Count all paths in 2D Matrix with Obstructions in it2016-06-20 19:37:31
Dynamic Programming – Count all paths from top left to bottom right of a mXn matrix2016-06-19 10:29:43
Reverse the given Array without using built in function2016-06-19 10:17:23
Print All Diagonals of a given matrix2016-06-17 22:55:55
Dynamic Programming – Edit Distance Problem2016-05-14 20:11:10
Dynamic Programming – Coin In a Line Game Problem2016-05-08 18:08:55
Dynamic Programming – Box Stacking Problem2016-04-17 17:23:51
Dynamic Programming – Split the String into Minimum number of Palindromes.2016-04-10 12:20:39
Dynamic Programming – Highway Billboard Problem2016-04-05 14:20:47
Dynamic Programming – Maximum Subarray Problem2016-04-03 19:00:09
Kadane’s Algorithm – Maximum Subarray Problem2016-03-31 01:18:59
Convert Binary Tree into Threaded Binary Tree2016-03-24 18:55:05
Double Threaded Binary Tree Complete Implementation2016-03-21 20:53:09
Single Threaded Binary Tree Complete Implementation2016-03-19 16:56:28
Introduction to Threaded Binary Tree2016-03-19 16:33:38
Implement Stack Using Linked List2016-03-19 13:18:13
Doubly Linked List Complete Implementation2016-03-18 20:34:04
Circular Linked List Complete Implementation2016-03-15 23:18:33
Swap Nodes in pairs in a Linked List by changing links2016-03-13 20:09:38
Convert BST to Greater Sum Tree2016-02-27 20:45:26
Shortest Range in K-sorted Lists2016-02-19 22:54:24
Reverse Alternative ‘k’ nodes in a Linked List.2016-02-18 19:25:06
Reverse a Linked List in groups of given size ‘K’2016-01-03 20:47:34
Generate Maximum revenue by selling K tickets from N windows2016-01-03 20:22:26
Get the Sum of all left leaves in a Binary tree2015-12-06 11:44:36
Convert binary tree to its Sum tree2015-12-06 11:32:11
Binary Tree-Postorder Traversal – Non Recursive Approach2015-12-05 14:57:45
Binary Tree – Preorder Traversal – Non Recursive Approach2015-12-05 12:33:53
Binary Tree-Inorder Traversal – Non Recursive Approach2015-12-04 23:59:57
Delete the Binary Tree2015-12-04 23:25:34
Search the Element in a binary tree – With and Without Recursion2015-12-04 23:10:45
Tree Traversals2015-11-08 13:01:11
Find the Size of a Binary Tree without Recursion2015-11-08 12:33:19
Dynamic Programming — Longest Palindromic Subsequence2015-08-04 22:15:53
Dynamic Programming – Maximum Product Cutting Problem.2015-07-11 10:16:50
Dynamic Programming – Minimum Numbers are Required Whose Square Sum is Equal To a Given Number2015-07-03 21:35:20
Dynamic Programming – Longest Common Substring2015-06-29 21:29:51
Dynamic Programming – Longest Common Subsequence2015-06-28 11:43:44
Dynamic Programming – Rod Cutting Problem2015-06-27 17:59:36
Dynamic Programming – Coin Change Problem2015-06-27 15:06:04
Dynamic Programming – Minimum Cost Path Problem2015-06-14 17:51:12
All N Length Strings from Given String of Length K2015-06-10 21:40:01
Generate Well Ordered Passwords of a Given Length K2015-06-10 21:34:53
Print All N Length Strings from Given Number K2015-06-10 21:19:49
Print All Possible Subsets with Sum equal to a given Number2015-06-08 20:56:00
Dynamic Programming – Maximum size square sub-matrix with all 1s2015-05-10 13:47:45
Dynamic Programming – Subset Sum Problem2015-05-10 13:34:32
The Word Break Problem2015-05-10 13:15:51
Dynamic Programming – Longest Increasing Subsequence2015-05-10 02:14:14
Backtracking – Knight’s Tour Problem2015-05-10 01:28:37
Backtracking – Search a Word In a Matrix2015-05-10 01:09:13
Backtracking – N Queens Problem – Better Solution2015-05-10 00:55:54
Backtracking – N Queens Problem2015-05-10 00:43:48
Find the Kth Smallest/Largest Element in an Array2015-05-10 00:31:22
Priority Queue in Data Structure2015-05-10 00:21:29
Find the Second Largest Element in an Array2015-05-09 23:52:38
Breadth-First Search/Traversal in a Graph.2015-05-09 23:44:09
Breadth-First Search/Traversal in a Binary Tree2015-05-09 23:16:32
Sort Names by their Last Names.2015-05-08 18:45:42
Backtracking – Rat In A Maze Puzzle2015-04-13 15:03:35
Backtracking – SUDOKU Solver2015-03-16 20:24:30
Introduction To Backtracking Programming2015-03-16 20:13:31
Dynamic Programming – Stairs Climbing Puzzle2015-03-16 20:04:44
Dynamic Programming – Minimum Coin Change Problem2015-03-16 19:57:27
Introduction To Dynamic Programming – Fibonacci Series2015-03-16 19:44:12
Merge K Sorted Arrays2015-03-14 15:33:24
Find the Deepest Left Node in a Binary Tree.2015-03-14 15:24:00
Find a Number occurring odd number of times in a Given array2015-03-14 15:11:50
Rearrange the Array of Given Range N, such that A[i]=i2015-03-14 15:06:50
Find a Missing Number From a Sequence of Consecutive Numbers | XOR Method2015-03-14 14:44:19
Find the Max element in a Given Binary Tree2015-03-14 14:40:48
Provide the Next Siblings Pointers in a Given Binary Tree2015-03-14 14:36:20
Check If One Binary is Mirror Tree of another Binary Tree.2015-03-14 14:21:10
Print All Paths From Root In a Binary Tree Whose Sum is Equal to a Given Number2015-03-14 14:14:08
Diameter Of a Binary Tree2015-03-14 14:08:57
Reverse Level Order Traversal2015-03-14 03:02:16
Find the Deepest Node in a Binary Tree.2015-03-14 02:15:48
Find the Height of a tree without Recursion2015-03-14 02:11:36
Print All The Full Nodes in a Binary Tree2015-03-14 02:02:33
Binary Min – Max Heap2015-02-22 17:21:28
Magic Index – Find Index In Sorted Array Such That A[i] = i.2015-02-22 17:06:00
Find numbers which are palindrome in both their decimal and octal Representations2015-02-22 16:02:07
Find All the Well Ordered Permutations of a Given String.2015-02-22 14:35:09
Find Increasing Triplet Sub-sequence2015-02-22 14:19:19
Construct a Special Triangle from a Given Array2015-02-22 14:10:01
Colorful Numbers2015-02-22 00:14:01
Print All the Subsets of a Given Set (Power Set)2015-02-21 23:59:01
Goldbach’s Conjecture2015-02-21 23:50:23
Convert Decimal into Irreducible Fraction2015-02-21 00:21:16
Clock Angle Problem2015-02-20 19:28:47
Print All Combinations of subset of size K from Given Array2015-02-20 19:07:29
Track the Maximum Element in a Stack.2015-02-16 16:24:07
Print All Possible Valid Combinations Of Parenthesis of Given ‘N’2015-02-05 14:14:38
Graph Representation – Adjacency Matrix and Adjacency List2015-02-02 17:38:37
Counting Sort2015-02-02 16:21:13
Towers Of Hanoi2015-02-02 16:15:09
Generate All Strings of n bits.2015-02-01 15:57:18
Find The Missing Duplicate in a Given Array.2015-02-01 15:40:25
Sort 3 Integers without using if condition OR use only Max() function.2015-02-01 15:30:49
Euclidean algorithm – Greatest Common Divisor(GCD)2015-01-31 23:46:08
Implement Queue Using Stacks2015-01-31 23:38:08
Alternate Splitting of a given Linked List2015-01-31 23:03:46
Reverse The Doubly Linked List2015-01-31 21:48:00
Swap Kth Node from the front with the Kth Node from the End2015-01-31 21:25:09
Print the Bottom View of the Binary Tree.2015-01-30 03:38:05
Delete X Nodes After Y Nodes In a Linked List2015-01-29 13:11:27
Merge Sort in a Linked list2015-01-29 12:55:27
Merge a Linked list into another Linked List at Alternate Positions.2015-01-05 20:22:52
AVL Tree – Insertion2014-12-30 23:10:35
Construct a binary tree from given Inorder and Level Order Traversal2014-12-30 21:46:58
Construct Binary Search Tree from a given Preorder Traversal Using Stack (Without Recursion)2014-12-30 05:55:03
Construct Binary Search Tree from a given Preorder Traversal using Recursion2014-12-30 05:45:40
Print The Top View of a Binary Tree2014-12-30 05:29:07
Construct a Binary Tree from Given Inorder and Depth-First-Search.2014-12-30 05:16:11
Depth First Search/Traversal in Binary Tree2014-12-30 05:03:06
Inorder Predecessor and Successor in Binary Search Tree2014-12-29 22:08:55
Check if Array Contains All Elements Of Some Given Range2014-12-29 20:44:38
Check if Array is Consecutive Integers2014-12-29 20:37:11
In an Array, find the Contiguous Subarray with Sum to a Given Value.2014-12-29 20:28:35
In an Array, find the Smallest Subarray with Sum Greater than the Given Value2014-12-29 20:18:37
Rearrange Positive and Negative Elements at Alternate Positions in an Array In O(1) Extra Space2014-12-28 06:21:34
Find intersection between Two Sorted Arrays.2014-12-28 06:09:47
Find Kth Smallest or Largest element in an Array.2014-12-28 06:02:44
Given an array arrA[], find the maximum j – i such that arr[j] > arr[i].2014-12-28 05:53:26
Find All Elements in an Array which appears more than N/K times, N is Array Size and k is a Number.2014-12-28 03:15:17
Search an Element in a Rotated Sorted Array2014-12-28 02:53:10
Print All The Nodes Which are X distance from the Given Node2014-12-08 23:37:27
Print All The Nodes Which are X distance from the Leaf Nodes2014-12-08 23:24:13
Print All The Nodes Which are X distance from the Root2014-12-08 23:16:50
Find the Distance between Two Nodes of a Binary Tree.2014-12-08 23:05:02
Find The Distance From Root To Given Node of a Binary Tree.2014-12-08 22:55:07
Construct a binary tree from given Inorder and Postorder Traversal2014-12-08 22:44:15
Print the Vertical Sum in binary Tree .2014-12-08 22:19:30
Print the Binary Tree in Vertical Order Path.2014-12-08 22:11:03
Lowest Common Ancestor in a Binary Tree (Not Binary Search Tree).2014-11-18 08:52:45
Lowest Common Ancestor in a Binary Search Tree.2014-11-18 08:28:54
Make a Binary Tree from Given Inorder and Preorder Traveral.2014-11-18 08:06:33
Given a binary tree, find out the maximum sum of value from root to each leaf.2014-11-18 07:50:13
Reverse Alternate levels of a given Binary Tree.2014-11-18 07:28:37
Given a Sorted Singly Linked List Array, Convert it into a Balanced Binary search Tree.2014-11-18 07:03:24
Given a binary tree, Convert it into its Mirror Tree2014-11-18 03:46:41
Given a binary tree, Print All the Nodes that don’t have Siblings.2014-11-18 02:46:53
Convert a Sorted Doubly Linked List to Balanced BST.2014-11-18 02:30:44
Given a binary tree, Find the Maximum Path Sum between Any Two Leaves2014-11-18 01:00:34
Print Left View of a given binary tree2014-11-18 00:46:23
Print Right View of a given binary tree2014-11-17 23:33:25
In a Binary Tree, Check if Two nodes has the same parent or are siblings2014-11-17 23:12:16
In a Binary Tree, Check if two nodes are Cousins2014-11-17 22:46:45
Check if Two BST’s are Identical2014-11-17 21:45:02
Print Paths from root to all leaf nodes in a binary tree.2014-11-17 21:14:09
Print All The Permutations Of a String2014-11-14 22:06:29
Sort an Given Array in the order defined by another array2014-11-14 21:02:52
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.2014-11-11 08:08:33
Print All Nodes Between Two Given Levels2014-11-11 07:54:34
Find the maximum width of a binary tree2014-11-11 05:23:43
Find the number of occurrences of a number in a given sorted array.2014-11-11 03:14:09
Find all common numbers in given three sorted arrays.2014-11-11 03:05:11
Level Order Traversal in Zig Zag pattern OR Print in Spiral Pattern2014-11-10 20:04:05
Find the first repeated element in an array by its index2014-11-10 18:58:58
Minimum number that cannot be formed by any subset of an array2014-11-10 18:21:30
Determine whether given binary tree is binary search tree(BST) or not2014-09-27 20:58:54
Find the Size of the Binary Tree2014-09-27 19:12:28
Given two binary trees, check if one binary tree is a subtree of another2014-09-27 18:18:22
Print a path from Root to Node in Binary Tree2014-09-27 18:04:50
Inorder Successor in Binary Search Tree without Using Parent link2014-09-27 16:46:09
Inorder Successor in Binary Search Tree Using Parent link2014-09-27 16:46:01
Inorder Successor in Binary Tree2014-09-27 16:45:50
Sorted Array to Binary Search Tree of Minimal Height2014-09-27 15:51:19
In a Binary Tree, Create Linked Lists of all the nodes at each depth.2014-09-22 21:38:14
Level Order Traversal, Print each level in separate line.2014-09-21 08:03:34
Find whether if a Given Binary Tree is Balanced?2014-09-21 01:16:54
Get the Height of a Node in a Binary Tree2014-09-20 17:05:05
Find the Maximum Depth OR Height of a Binary Tree2014-09-19 15:53:16
Add two numbers represented by a linked list, Numbers are Stored in FORWARD order2014-09-16 22:59:40
Add two numbers represented by a linked list, Numbers are Stored in REVERSE order2014-09-16 22:28:49
Reverse the binary representation of a number.2014-09-16 20:32:30
Binary Search Tree Complete Implementation.2014-09-16 00:38:04
Reverse a Linked List – Part 22014-09-14 03:13:55
Swap Every Kth Node in a LinkedList2014-09-14 03:02:40
Delete a Node in the Middle of a linked list, Given only access to that Node2014-09-12 17:16:37
Find the n’th Node from the end of a given Linked List2014-09-12 06:40:00
Remove Duplicates from an Unsorted Linked list2014-09-11 17:06:30
Check if one string is Rotation of another string2014-09-09 23:29:04
String Compression using count of repeated characters – Run Length Encoding2014-09-09 02:49:24
Replace all spaces in a String with ‘%20’2014-09-08 05:26:30
Find Whether Two Strings are Permutation of each other2014-09-08 05:19:13
Find Intersection Point in Two Linked List2014-09-06 17:41:44
Find the Loop in a Linked list, find its length and Break the Loop2014-09-05 21:49:36
Reverse a Linked List2014-08-28 16:54:29
Count All Paths from Top left to bottom right in Two Dimensional Array including Diagonal Paths2014-08-25 04:11:48
Print All Paths from Top left to bottom right in Two Dimensional Array2014-08-13 14:43:45
Merge or Combine Two Sorted Linked Lists2014-08-12 14:58:31
Singly Linked List Implementation2014-08-12 14:34:27
Rearrange Positive and Negative Numbers of Array On Each Side in O(nlogn)2014-08-04 17:50:28
Find The Longest Sequence Of Prefix Shared By All The Words In A String, 2014-08-04 17:37:31
Print All Elements of Two Dimensional Array in Spiral2014-08-04 17:11:31
Find a pair of numbers from an array whose sum equals k2014-08-04 02:01:38
Check If String has All Unique Characters2014-08-03 05:49:14
Quick Sort Implementation2014-08-03 02:22:30
Find Whether Given Sequence of parentheses are well formed.2014-07-23 19:08:54
Find an Element in 2 dimensional sorted array2014-07-20 22:27:52
Find Whether Given String is palindrome or Not.2014-07-20 22:19:24
Find a peak element in a Given Array2014-07-20 22:12:23
Find two Missing Numbers in a Sequence of Consecutive Numbers2014-07-20 22:05:30
Find a Missing Number From a Sequence of Consecutive Numbers2014-07-20 22:00:05
Hash Table Implementation2014-07-20 21:54:06
Merge Sort – Updated – Most Efficient ways to Implement2014-07-20 21:41:14
Binary Search2014-07-20 15:35:10

%d bloggers like this: