Skip to content

Latest commit

 

History

History

README.md

Interview preparation topics

New Concepts

Data Structures and Algorithms

Linked List Problems

  1. Find the middle element of a singly linked list in one pass
  2. Reverse a singly linked list with recursion
  3. Remove duplicate nodes in an unsorted linked list
  4. Find the length of a singly linked list
  5. Check if a given linked list contains a cycle? How do you find the starting node of the cycle
  6. Reverse a linked list
  7. Find the nth node from the end in a singly linked list
  8. Merge two sorted linked list
  9. Find the sum of two linked lists using Stack
  10. Find intersection of two Linked Lists - O(m + n) Time Complexity and O(1) Space Complexity

Tree Problems

  1. Check if two given binary trees are identical or not | Iterative & Recursive
  2. Calculate height of a binary tree | Iterative & Recursive
  3. Inorder Tree Traversal | Iterative & Recursive
  4. Preorder Tree Traversal | Iterative & Recursive
  5. Postorder Tree Traversal | Iterative & Recursive
  6. Level Order Traversal of Binary Tree
  7. Spiral Order Traversal of Binary Tree
  8. Reverse Level Order Traversal of Binary Tree
  9. Print Left View of a Binary Tree
  10. Print Right View of a Binary Tree
  11. Print Bottom View of Binary Tree
  12. Print Top View of Binary Tree
  13. Find diameter of a binary tree
  14. Convert binary tree to its mirror
  15. Find Lowest Common Ancestor (LCA) of two nodes in a binary tree
  16. Print all paths from root to leaf nodes in given binary tree
  17. Find ancestors of given node in a Binary Tree
  18. Find Vertical Sum in a given Binary Tree
  19. Find the diagonal sum of given binary tree
  20. Find node having maximum value in binary tree
  21. Find size of a binary tree
  22. Find number of leaves in a binary tree
  23. Find level that has maximum sum
  24. Check existence of path with given sum
  25. Find sum of all nodes
  26. Remove vowels from a string stored in a Binary Tree
  27. Construct binary tree given an array
  28. Print all nodes of a given binary tree in specific order
  29. Find next node in same level for given node in a binary tree
  30. Determine if given two nodes are cousins of each other
  31. In-place convert given binary tree to its sum tree
  32. Check if given binary tree is a sum tree or not
  33. Determine if given binary tree is a subtree of another binary tree or not

To be done | source

  • Check if given binary tree is complete binary tree or not
  • Print cousins of given node in a binary tree
  • Check if given binary Tree has symmetric structure or not
  • Find the distance between given pairs of nodes in a binary tree
  • Print nodes in vertical order of a given Binary Tree (Vertical Traversal)
  • Print Diagonal Traversal of Binary Tree
  • Print corner nodes of every level in binary tree
  • In-place convert convert given Binary Tree to Doubly Linked List
  • Sink nodes containing zero to the bottom of the binary tree
  • Convert given binary tree to full tree by removing half nodes
  • Truncate given binary tree to remove nodes which lie on a path having sum less than K
  • Find maximum sum root-to-leaf path in a binary tree
  • Determine if given Binary Tree is a BST or not
  • Convert a Binary Tree to BST by maintaining its original structure
  • Invert given Binary Tree | Recursive and Iterative solution
  • Print leaf to root path for every leaf node in a binary tree

Stack Problems

  1. Design a stack which returns minimum element in constant time
  2. Check if given expression is balanced expression or not
  3. Stock Buy Sell to Maximize Profit
  4. Sort a stack using recursion
  5. Sort a stack using a temporary stack
  6. Reverse a stack using recursion

To be done

Queue Problems

  1. Implement stack using queues
  2. Implement Queue using stacks
  3. Given an array and integer k, write an algorithm to find the maximum element in each subarray of size k
  4. Sort a stack using a temporary stack

Matrix Problems

  1. Print matrix diagonally

Dynamic Programming Problems

  1. Edit Distance
  2. Subset Sum Problem
  3. 0-1 Knapsack Problem
  4. Rod Cutting
  5. Coin change problem
  6. Count the number of islands
  7. Weighted Job Scheduling
  8. Count and print all Subarrays with product less than K in O(n)
  9. Find maximum meetings in one room

To be done | source

Array Problems

  1. Longest Increasing Subsequence
  2. Largest Sum Contiguous Subarray
  3. Find the Missing Number in the array
  4. Print all subsets of an array
  5. Sort an array of 0s, 1s and 2s

Misc Problems

  1. Determine the given routing number belong to which bank
  2. Convert Integer to Roman
  3. Top 10 occurring words in a very large file java algorithm
  4. Build a Sudoku Solver in Java
  5. Find Itinerary from a given list of tickets
  6. Minimum Number of Platforms Required for a Railway/Bus Station
  7. Find the first circular tour that visits all petrol pumps