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


  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


  1. Number following the pattern
  2. Print bracket number

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


  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

Dynamic Programming

  1. 0-1 Knapsack Algorithm
  2. House Robber
  3. Coin Change
  4. Word Break Problem
  5. Friends pairing problem
  6. Maximum Profit in Stock Buy and sell with at most K Transaction
  7. Floyd Warshall Algorithm
  8. Optimal Strategy for a Game
  9. Highway billboard
  10. Gold Mine Problem
  11. Longest Increasing Subsequence
  12. Minimum Number of coins to make the change
  13. Get Minimum Squares
  14. Count Numbers with unique digits
  15. Maximum Sum Problem
  16. Find number of times a string occurs as a subsequence
  17. Number of Unique Paths
  18. Minimum number of jumps
  19. Rod Cutting
  20. Dice throw
  21. Longest Common Subsequence
  22. Longest Repeating Subsequence
  23. Length of the Longest Bitonic Subsequence
  24. Print the Longest Bitonic Subsequence
  25. Find out the longest palindromic subsequence from a string
  26. Find out the length of the longest palindromic subsequence from a string
  27. Count the number of palindromic subsequences in a given string
  28. Subset Sum
  29. Equal Sum partition


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


  1. Palindromic Array

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


  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.