Interview coding problems/challenges

Hey geeks! Up for solving the problems which are being asked in interviews?

Here you go...

We are trying to list out the most frequently asked interview problems or the problem given in the coding rounds of IT giants.

For you we have detailed analysis:

  • A proper explanation of question with explanations so that you can have a nice idea of your own and can think about a solution yourself.
  • A detailed explanation of the solution with a generalized algorithm so that you can code yourself without checking our codes given at the end.
  • If still, you have issues to figure out a solution then step by step explanation of the code. A detailed explanation of how the code works with the example?
  • Don't think you will need anything more!!

Benefits if you hit our Interview coding problems pages: Definitely, we may have better ad sense earning more you hit the pages. But it’s not actually for us. The more you hit, the more you practice, the more you get prepared. You have to do some serious coding if you need to get hired. All over the net, you are surely in a loop considering where to start from. Here are we to light you up and that’s why we chose and place the best problems here. Some may seem to be easy, some may seem to be tough. No, issue if it’s easy just check whether you have a more optimized solution or not. If you have a more optimized solution, then feel free to post in the comments. Remember sharing is caring!!


  1. Run-length encoding (find/print frequency of letters in a string)
  2. Checking Anagrams (check whether two string is anagrams or not)
  3. Count and Say sequence
  4. Longest Common Prefix
  5. Count Substrings
  6. Number following the pattern
  7. Next Permutation
  8. Convert Ternary Expression to Binary Tree
  9. Count of strings that can be formed using a, b and c under given constraints
  10. Minimum Number of Flips
  11. Count Occurrences of Anagrams
  12. Rearrange a string
  13. Print bracket number
  14. Longest Palindromic Subsequence
  15. Preorder to Postorder of BST


  1. Sort an array of 0's, 1's and 2's in linear time complexity
  2. Check for Valid Sudoku
  3. Palindromic Array
  4. Largest Fibonacci Subsequence
  5. Pairs of songs with total durations divisible by 60
  6. All subarray Sum of an array


  1. Sort an array of 0's, 1's and 2's in linear time complexity
  2. Relative sorting algorithm


  1. Finding First Bad Version
  2. Maximum value in a bitonic array

Coding Algorithms

  1. Run-length encoding (find/print frequency of letters in a string)
  2. Sort an array of 0's, 1's and 2's in linear time complexity
  3. Finding subarray with given sum
  4. 1[0]1 Pattern Count
  5. Capitalize first and last letter of each word in a line
  6. Greedy Strategy to solve major algorithm problems
  7. Job sequencing problem
  8. Exit Point in a Matrix
  9. Generate Gray Code Sequences
  10. Picking Numbers


  1. Find the level in a binary tree with given sum K
  2. Check whether a Binary Tree is BST (Binary Search Tree) or not
  3. Print vertical sum of a binary tree
  4. Print Boundary Sum of a Binary Tree
  5. Root to leaf Path Sum
  6. Print All Nodes that don't have Sibling
  7. Two Mirror Trees
  8. Transform to Sum Tree
  9. Symmetric Tree
  10. Convert Sorted Array to Binary Search Tree
  11. Odd even level difference in a binary tree
  12. Check if Tree is Isomorphic
  13. Expression Tree
  14. K distance from root
  15. Right View of Binary Tree
  16. Diameter of Binary Tree
  17. Delete nodes greater than or equal to k in a BST
  18. Reverse Level Order Traversal
  19. Diagonal Traversal of Binary Tree
  20. Leftmost and Rightmost Nodes of Binary Tree
  21. Lowest Common Ancestor in a BST
  22. Convert Ternary Expression to Binary Tree
  23. Bottom View of Binary Tree
  24. Ancestors in Binary Tree
  25. All Root to Leaf Paths
  26. Sum of all numbers formed by root to leaf path
  27. Minimum distance between two given nodes of a Binary Tree
  28. K-th smallest element in a Binary Search Tree
  29. Level order traversal in spiral form
  30. Maximum path sum in a binary tree
  31. Preorder to Postorder of BST


  1. Number following the pattern
  2. Print bracket number
  3. Stock Span Problem
  4. Redundant Bracket
  5. Postfix Expression Evaluation
  6. Largest rectangle area in a histogram

Linked list

  1. Reverse a single linked list
  2. Find length of loop in a linked list
  3. Palindrome Linked List
  4. Intersection Point in Y-Shaped Linked List
  5. Absolute sorting on a single linked list
  6. Sum of two numbers represented by linked lists


  1. Rotten Oranges
  2. Alien Dictionary
  3. Find the number of islands
  4. Check a graph is Hamiltonian or not (Hamiltonian path)
  5. Knight walk problem
  6. Floyd Warshall Algorithm

Greedy Algorithms

  1. Greedy Strategy to solve major algorithm problems
  2. Job sequencing problem
  3. Fractional knapsack problem
  4. Rain Water Trapping Problem

Dynamic Programming

  1. 0-1 Knapsack Algorithm
  2. House Robber
  3. Coin Change
  4. Minimum Coin Change | Find minimum number of coins that make a given value
  5. Word Break Problem
  6. Friends pairing problem
  7. Maximum Profit in Stock Buy and sell with at most K Transaction
  8. Floyd Warshall Algorithm
  9. Optimal Strategy for a Game
  10. Highway billboard
  11. Gold Mine Problem
  12. Longest Increasing Subsequence
  13. Minimum Number of coins to make the change
  14. Get Minimum Squares
  15. Count Numbers with unique digits
  16. Maximum Sum Problem
  17. Find number of times a string occurs as a subsequence
  18. Number of Unique Paths
  19. Minimum number of jumps
  20. Rod Cutting
  21. Dice throw
  22. Longest Common Subsequence
  23. Longest Repeating Subsequence
  24. Length of the Longest Bitonic Subsequence
  25. Print the Longest Bitonic Subsequence
  26. Find out the longest palindromic subsequence from a string
  27. Find out the length of the longest palindromic subsequence from a string
  28. Count the number of palindromic subsequences in a given string
  29. Subset Sum
  30. Equal Sum partition
  31. Maximize the cut segments
  32. Pizza Mania Problem
  33. Letter/Blog Writer Coding Problem (using Dynamic Programming)
  34. Largest zigzag sequence
  35. Number of ways to construct the grid
  36. Minimum number of deletions to make a string palindrome
  37. Minimum Cost to Make Two Strings Identical
  38. Shortest Common Super Sequence
  39. Printing Longest Common Subsequence
  40. Wine selling problem | Find the maximum profit from sale of wines
  41. Egg Dropping Problem
  42. Probability of getting more number of heads than tails if coins are tossed
  43. Minimum Path Sum
  44. Maximum path sum in a binary tree


  1. Exit Point in a Matrix
  2. Shortest Source to Destination Path
  3. Gold Mine Problem


  1. Palindromic Array
  2. Wine selling problem | Find the maximum profit from sale of wines
  3. Minimum Coin Change | Find minimum number of coins that make a given value
  4. Egg Dropping Problem
  5. Maximum path sum in a binary tree

Number theory

  1. Sieve of Eratosthenes

Bitwise operators

  1. Game of XOR


  1. Prisoners and the poison


  1. Total number of non-decreasing numbers with n digits


  1. String Matrix
  2. Tug of War
  3. Backtracking to find all subsets
  4. Find out the sum-string
  5. Power Set in Lexicographic order
  6. Fill 8 numbers in a matrix
  7. Partition a set into k subset with equal sum
  8. Combinational sum problem
  9. Combinational sum problem with repetition of digits
  10. Match a pattern and String without using regular expressions
  11. Warnsdorff's algorithm for Knight's tour problem

Iterative approach

  1. Find the largest palindromic substring using O(1) space complexity

Trie Data Structure

  1. Check the consistency of the numbers (Trie Data Structure Question)


  1. Length of the largest subarray with equal number of 0s and 1s

Brute Force

  1. Stock Span Problem
  2. Rain Water Trapping Problem
  3. Largest rectangle area in a histogram


  1. Redundant Bracket
  2. Rain Water Trapping Problem
  3. Longest Prefix and Suffix


  1. Find nth Magic number
  2. Toppers of Class
  3. Where is my seat?
  4. Google CodeJam 2019 | Foregone Solution
  5. Find the perfect land of C shape
  6. Find the magic matrix

Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.