Open In App
Related Articles

Must Do Coding Questions for Product Based Companies

Like Article
Save Article
Report issue

As the placement season is back, GeeksforGeeks is here to help you crack the interview. We have selected some most commonly asked and MUST DO practice problems to crack Product-based Company Interviews.

You can also take part in our mock placement contests which will help you learn different topics and practice at the same time, simulating the feeling of a real placement test environment.


Note: Now you can track your progress and learn from video editorials of these questions Must Do Interview Preparation Course.




Missing Number in ArrayLinkLink
Trailing Zeros in FactorialLinkLink
A Simple FractionLinkLink
Nth Natural NumberLinkLink
Smallest Positive Integer that can not be represented as SumLinkLink


An array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together.

Rotate ArrayLinkLink
Majority ElementLinkLink
Plus oneLinkLink
Array of alternative +ve and -ve no.sLinkLink
Product Array puzzleLinkLink
Frequencies of Limited Range Array ElementsLinkLink
Large FactorialLinkLink
Jump GameLinkLink
Maximum number of 1’sLinkLink
Stock Buy and SellLinkLink
Longest Consecutive SubsequenceLinkLink
Maximum value of difference of a pair of elements and their IndexLinkLink
Maximum indexLinkLink
K-th element of two sorted ArraysLinkLink
Trapping Rain WaterLinkLink
3 sum closestLinkLink
Maximum circular Subarray SumLinkLink
Merge without Extra SpaceLinkLink


Search insert position of K in a sorted arrayLinkLink
Collecting WoodLinkLink
Left most and right most indexLinkLink
Bitonic Point LinkLink
Search an element in sorted and rotated arrayLinkLink
Square root of a numberLinkLink
Find missing in second arrayLinkLink
Painter’s Partition ProblemLinkLink
Median of 2 sorted arrays of Different sizesLinkLink
Allocate minimum number of pagesLinkLink


Wave arrayLinkLink
Count the number of possible trianglesLinkLink
Triplets with sum with given rangeLinkLink
Count InversionsLinkLink
Relative SortingLinkLink
Minimum PlatformsLinkLink
Maximum IndexLinkLink


A matrix represents a collection of numbers arranged in an order of rows and columns. It is necessary to enclose the elements of a matrix in parentheses or brackets.

Sort a 2D vector diagonallyLinkLink
Spiral MatrixLinkLink
Boolean matrixLinkLink
Rotate matrix by 90 degreesLinkLink
Search in a row-column sorted MatrixLinkLink
Row with maximum 1sLinkLink


Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character ‘\0’.

Reverse words in a given stringLinkLink
Longest Common PrefixLinkLink
Roman Number to IntegerLinkLink
Next higher palindrome number using the same set of digitsLinkLink
Length of longest prefix suffixLinkLink
Smallest window in string containing all charactersLinkLink
Validate an IP addressLinkLink
Implement AtoiLinkLink
Look and say PatternLinkLink
Longest K unique characters substringLinkLink


Key PairLinkLink
Top K Frequent Elements in ArrayLinkLink
Intersection of two arraysLinkLink
Array Pair Sum Divisibility ProblemLinkLink
Triplet Sum in ArrayLinkLink
Length of the longest substringLinkLink
Is Sudoku ValidLinkLink
Print Anagrams Together LinkLink
Subarrays with sum KLinkLink
Longest subarray with sum divisible by KLinkLink

Bit Masking

Reverse bitsLinkLink
Number of set bitsLinkLink
Sum of two integersLinkLink
Check whether K-th bit is set or notLinkLink
Longest Consecutive 1’sLinkLink
Find the element that appears onceLinkLink
Gray codeLinkLink
Maximum ANDLinkLink
Maximum subset XORLinkLink
Bit DifferenceLinkLink

Linked List

A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations.

Merge Two Sorted Linked ListsLinkLink
Reverse a Linked ListLinkLink
Delete a Node without Head PointerLinkLink
Add two Numbers represented by linked listsLinkLink
Finding middle element in a linked listLinkLink
Check if linked list is palindromeLinkLink
Rearrange a linked listLinkLink
Detect and Remove a loop In Linked ListLinkLink
Merge Sort for Linked ListLinkLink
Intersection of Linked ListLinkLink
Rotate Linked List by K placesLinkLink
Flattening a Linked ListLinkLink
Reverse a linked list in groups of given sizeLinkLink
Partition a linked list around a given valueLinkLink
Clone a linked list with next and random pointersLinkLink


A stack is a linear data structure in which elements can be inserted and deleted only from one side of the list, called the top. A stack follows the LIFO (Last In First Out) principle.

Parenthesis CheckerLinkLink
Infix to PostfixLinkLink
Restrictive Candy CrushLinkLink
Next Larger Element LinkLink
Stock span problemLinkLink
The Celebrity ProblemLinkLink
Maximum Rectangular Area in a Histogram LinkLink
Longest Valid ParenthesesLinkLink
Maximum of minimum for every window sizeLinkLink
Remove K digitsLinkLink
132 Geeky BuildingsLinkLink


A queue is a linear data structure in which elements can be inserted only from one side of the list called rear, and the elements can be deleted only from the other side called the front. The queue data structure follows the FIFO (First In First Out) principle.

Maximum of all subarrays of size KLinkLink
Circular tour (Sliding Window)LinkLink


A Heap is a special Tree-based data structure in which the tree is a complete binary tree.

Rearrange CharactersLinkLink
Minimum Cost of ropesLinkLink
Kth largest element of streamLinkLink
Merge k sorted arraysLinkLink
Median of streamLinkLink

Binary Tree

A tree whose elements have at most 2 children is called a binary tree. Since each element in a binary tree can have only 2 children, we typically name them the left and right child.

Symmetric TreeLinkLink
Zigzag Tree TraversalLinkLink
Checked for Balanced treeLinkLink
Height of Binary TreeLinkLink
Diameter of Binary treeLinkLink
Determine if two trees are identicalLinkLink
Minimum depth of binary treeLinkLink
Check if subtreeLinkLink
Inorder Traversal (iterative)LinkLink
Preorder Traversal (iterative)LinkLink
Postorder Traversal(iterative)LinkLink
Vertical Traversal of a Binary TreeLinkLink
Construct Binary Tree from Preorder and Inorder TraversalLinkLink
Connect nodes at same levelLinkLink
Lowest Common Ancestor of a Binary TreeLinkLink
Boundary TraversalLinkLink
Sum treeLinkLink
Binary Tree to Doubly Linked ListLinkLink
Maximum sum path between two leaf nodesLinkLink
Burning TreeLinkLink

Binary Search Tree

Binary Search Tree is a node-based binary tree data structure which has the following properties:

  • The left subtree of a node contains only nodes with keys lesser than the node’s key.
  • The right subtree of a node contains only nodes with keys greater than the node’s key.
  • The left and right subtree each must also be a binary search tree.
Check for BSTLinkLink
Array to BSTLinkLink
Inorder Successor in BSTLinkLink
Kth Largest Element in a BSTLinkLink
Remove BST keys outside the given rangeLinkLink
Pair with given target in BSTLinkLink
Unique BSTsLinkLink
Preorder Traversal and BSTLinkLink
Merge two BST’sLinkLink
Fixing two nodes of a BSTLinkLink


A Graph is a non-linear data structure consisting of nodes and edges. The nodes are sometimes also referred to as vertices and the edges are lines or arcs that connect any two nodes in the graph.

Number of IslandsLinkLink
COVID SpreadLinkLink
Prerequisite tasksLinkLink
Strongly Connected ComponentLinkLink
Minimum swaps to sortLinkLink
Shortest pathLinkLink
Circle of StringsLinkLink
Snake and Ladder Problem LinkLink
Detect cycle in an undirected graphLinkLink
Detect cycle in a directed graphLinkLink
Check for Bipartite graphLinkLink
Unit Area of Largest region of 1sLinkLink
Alien DictionaryLinkLink
Word LadderLinkLink


Trie is an efficient information retrieval data structure. Using Trie, search complexities can be brought to optimal limit (key length).

Minimum XOR value pairLinkLink
Word Boggle – IILinkLink
Most frequent word in an array of stringsLinkLink
Minimum XOR value pairLinkLink


Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit.

N meetings in one roomLinkLink
Coin PilesLinkLink
Maximize ToysLinkLink
Largest number with given sumLinkLink
Minimize the heightsLinkLink
Fractional KnapsackLinkLink
Job SequencingLinkLink
Police and ThievesLinkLink
Water the PlantsLinkLink


Dynamic Programming is mainly an optimization over plain recursion. Wherever we see a recursive solution that has repeated calls for same inputs, we can optimize it using Dynamic Programming.

Count ways to reach the n’th stairLinkLink
Get Minimum SquaresLinkLink
Nth Fibonacci NumberLinkLink
0 – 1 Knapsack ProblemLinkLink
Number of CoinsLinkLink
Edit distanceLinkLink
Maximize The Cut SegmentsLinkLink
Box StackingLinkLink
Longest Increasing SubsequenceLinkLink
Longest Palindromic SubstringLinkLink
Longest Common SubstringLinkLink
Longest Common SubsequenceLinkLink
Wildcard Pattern MatchingLinkLink
Total Decoding MessagesLinkLink
Max length chainLinkLink
Maximum sum increasing subsequenceLinkLink
Minimum number of jumpsLinkLink
Subset Sum ProblemLinkLink
Maximum path sum in matrixLinkLink
Player with max scoreLinkLink
Shortest Common SupersequenceLinkLink
Palindrome PartitioningLinkLink
Form a PalindromeLinkLink
Boolean ParenthesizationLinkLink
Matrix ChainLinkLink
Maximum ProfitLinkLink
Minimum Cost PathLinkLink
Partition Equal Subset SumLinkLink


The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive function.

Number of PathsLinkLink
Pascals TriangleLinkLink
Josephus problemLinkLink
Tower of HanoiLinkLink
Special KeyboardLinkLink
Flood Fill AlgorithmLinkLink


Backtracking is an algorithmic-technique for solving problems recursively by trying to build a solution incrementally, one piece at a time, removing those solutions that fail to satisfy the constraints of the problem at any point of time (by time, here, is referred to the time elapsed till reaching any level of the search tree).

Permutations LinkLink
Letter Combinations of a Phone NumberLinkLink
Generate ParenthesesLinkLink
Word Boggle – 1LinkLink
Rat in a Maze ProblemLinkLink
Largest number in K swapsLinkLink
Combination SumLinkLink
Palindrome PartitioningLinkLink
N-Queen ProblemLinkLink
Solve the SudokuLinkLink


Bubble SortLinkLink
Insertion SortLinkLink
Selection SortLinkLink
Merge SortLinkLink
Quick SortLinkLink
Heap SortLinkLink
Count SortLinkLink
Kadane AlgorithmLinkLink
Minimum Spanning TreeLinkLink
Implementing Dijkstra AlgorithmLinkLink
Floyd WarshallLinkLink
Bellman Ford AlgorithmLinkLink
Rabin-Karp AlgorithmLinkLink
KMP algorithmLinkLink
Z AlgorithmLinkLink
Huffman EncodingLinkLink


Stack using two queuesLinkLink
Queue using stackLinkLink
Ternary SearchLinkLink
Binary Heap OperationsLinkLink
LRU cacheLinkLink
Trie | (Insert and Search)LinkLink
You may also check our latest online course series to learn DS & Algo is named DSA, which covers everything about Data Structures from Basic to Advanced.


GeeksforGeeks Courses

Must Do Coding Questions – Self Paced Course

Luck favours the prepared, start practising now! This Must Do Coding Questions – Self Paced will help you become a top coder by practising the Must Do Coding Questions curated by the leading industry experts. Prepare and practice for your next coding interview with over 250+ practice problems on topics like Arrays, Searching, Sorting, Linked List, Matrix, String, Graphs, and much more.

Complete Interview Preparation

We often ask ourselves, why are we not able to crack our interviews? Where are we lacking exactly? How do we do it? If you are also having these questions, then don’t worry. We are here to help you with your interview preparation. Beginning with learning concepts like OOP, DSA, and Aptitude to working on projects with resume building. Everything at one place. Don’t wait and get yourself enrolled in our Complete Interview Preparation now.

Like Article
Save Article
Share your thoughts in the comments
Similar Reads