250+ Coding Interview Questions Asked in Service-Based Companies (with Company Tags & Links)
Posted on: Sat Jun 28 2025
- Reverse a string – Asked in: Infosys
-
Check if a string is a palindrome – Asked in: Capgemini
-
Find the factorial of a number – Asked in: Wipro
-
Find the largest number in an array – Asked in: TCS
-
Find the smallest number in an array – Asked in: Cognizant
-
Calculate the sum of array elements – Asked in: Infosys
-
Count even and odd numbers in an array – Asked in: Accenture
-
Count vowels and consonants in a string – Asked in: IBM
-
Swap two numbers – Asked in: TCS
-
Print Fibonacci series – Asked in: Infosys
-
Check if a number is prime – Asked in: Wipro
-
Find GCD of two numbers – Asked in: TCS
-
Find LCM of two numbers – Asked in: Infosys
-
Check Armstrong number – Asked in: Capgemini
-
Check Perfect number – Asked in: Cognizant
-
Reverse a number – Asked in: IBM
-
Count digits in a number – Asked in: Accenture
-
Print prime numbers in a range – Asked in: TCS
-
Print multiplication table – Asked in: Infosys
-
Find power of a number – Asked in: Wipro
-
Convert binary to decimal – Asked in: Capgemini
-
Convert decimal to binary – Asked in: Cognizant
-
Remove duplicates from an array – Asked in: Infosys
-
Find frequency of elements in an array – Asked in: Accenture
-
Sort array using bubble sort – Asked in: TCS
-
Sort array using selection sort – Asked in: Wipro
-
Find second largest element – Asked in: IBM
-
Find second smallest element – Asked in: Capgemini
-
Merge two arrays – Asked in: Infosys
-
Find missing number in array (1 to N) – Asked in: TCS
-
Count occurrences of a character in string – Asked in: Wipro
-
Capitalize first letter of each word in string – Asked in: Accenture
-
Remove all white spaces from string – Asked in: Infosys
-
Replace character in string – Asked in: Cognizant
-
Remove special characters from string – Asked in: TCS
-
Compare two strings – Asked in: Wipro
-
Find length of string without using length() – Asked in: Capgemini
-
Convert lowercase to uppercase – Asked in: Infosys
-
Convert string to integer – Asked in: IBM
-
Convert integer to string – Asked in: Accenture
-
Find ASCII value of character – Asked in: TCS
-
Check if strings are anagrams – Asked in: Capgemini
-
Count number of words in string – Asked in: Infosys
-
Remove duplicates from string – Asked in: Wipro
-
Check if array is sorted – Asked in: Cognizant
-
Implement linear search – Asked in: TCS
-
Implement binary search – Asked in: Infosys
-
Find intersection of two arrays – Asked in: Wipro
-
Find union of two arrays – Asked in: Accenture
-
Find sum of digits of number – Asked in: Capgemini
...
-
Find common elements in three sorted arrays – Asked in: Infosys
-
Check for pair with given sum in array – Asked in: Capgemini
-
Find majority element in array – Asked in: TCS
-
Kadane’s Algorithm – Max subarray sum – Asked in: Wipro
-
Check if array contains duplicate – Asked in: Infosys
-
Check if two strings are isomorphic – Asked in: IBM
-
Longest common prefix – Asked in: Accenture
-
Longest substring without repeating characters – Asked in: TCS
-
Group anagrams – Asked in: Wipro
-
Check if linked list is palindrome – Asked in: Infosys
-
Find middle of linked list – Asked in: Capgemini
-
Detect loop in linked list – Asked in: TCS
-
Remove Nth node from end – Asked in: Cognizant
-
Merge two sorted linked lists – Asked in: Wipro
-
Reverse a linked list – Asked in: Infosys
-
Find intersection of two linked lists – Asked in: Accenture
-
Add two numbers as linked list – Asked in: IBM
-
Remove duplicates from sorted list – Asked in: Capgemini
-
Delete node in a linked list – Asked in: TCS
-
Odd even linked list – Asked in: Wipro
-
Detect and remove loop in linked list – Asked in: Infosys
-
Implement stack using arrays – Asked in: Capgemini
-
Implement queue using arrays – Asked in: TCS
-
Implement circular queue – Asked in: Cognizant
-
Infix to postfix conversion – Asked in: Wipro
-
Evaluate postfix expression – Asked in: Infosys
-
Next greater element – Asked in: Accenture
-
Balanced parentheses – Asked in: IBM
-
Stock span problem – Asked in: Capgemini
-
LRU Cache implementation – Asked in: TCS
-
Insert interval – Asked in: Wipro
-
Merge intervals – Asked in: Infosys
-
Minimum platforms required – Asked in: Capgemini
-
Job scheduling problem – Asked in: TCS
-
N meeting in one room – Asked in: Wipro
-
Activity selection problem – Asked in: Infosys
-
Fractional knapsack problem – Asked in: IBM
-
0/1 Knapsack problem – Asked in: Accenture
-
Longest common subsequence – Asked in: TCS
-
Longest palindromic subsequence – Asked in: Capgemini
-
Coin change problem – Asked in: Infosys
-
Rod cutting problem – Asked in: Cognizant
-
Minimum number of coins – Asked in: Accenture
-
Subset sum problem – Asked in: Wipro
-
Word break problem – Asked in: IBM
-
Longest increasing subsequence – Asked in: TCS
-
Maximum product subarray – Asked in: Infosys
-
Edit distance – Asked in: Capgemini
-
Boolean parenthesization problem – Asked in: Wipro
-
Palindrome partitioning – Asked in: TCS
...
-
Two Sum Problem – Asked in: TCS
-
Move zeros to end of array – Asked in: Wipro
-
Rotate array by K elements – Asked in: Infosys
-
Check if subarray with 0 sum exists – Asked in: Capgemini
-
Find longest subarray with given sum – Asked in: Cognizant
-
Maximum sum increasing subsequence – Asked in: Infosys
-
Trapping Rain Water – Asked in: TCS
-
Minimum jumps to reach end – Asked in: Wipro
-
Chocolate Distribution Problem – Asked in: Capgemini
-
Activity Selection (Greedy) – Asked in: Accenture
-
Find missing and repeating number – Asked in: TCS
-
Find duplicate number (Floyd's Cycle) – Asked in: Infosys
-
Set Matrix Zeroes – Asked in: Wipro
-
Spiral Matrix – Asked in: Capgemini
-
Search in a sorted 2D matrix – Asked in: IBM
-
Find peak element – Asked in: Accenture
-
Kth smallest element in array – Asked in: TCS
-
Kth largest element using heap – Asked in: Infosys
-
Sliding window maximum – Asked in: Wipro
-
First negative integer in window – Asked in: Capgemini
-
Check if brackets are balanced – Asked in: Infosys
-
Implement queue using stack – Asked in: IBM
-
Implement stack using queue – Asked in: Accenture
-
LRU Cache – Asked in: Capgemini
-
LFU Cache – Asked in: Wipro
-
Flatten a linked list – Asked in: TCS
-
Clone a linked list with random pointer – Asked in: Infosys
-
Sort a stack – Asked in: Capgemini
-
Delete middle of a stack – Asked in: Wipro
-
Insert at bottom of stack – Asked in: TCS
-
Check for balanced tree – Asked in: Infosys
-
Diameter of binary tree – Asked in: Capgemini
-
Invert binary tree – Asked in: IBM
-
Zigzag traversal of binary tree – Asked in: Accenture
-
Boundary traversal of binary tree – Asked in: TCS
-
Top view of binary tree – Asked in: Infosys
-
Bottom view of binary tree – Asked in: Capgemini
-
Vertical order traversal – Asked in: Wipro
-
Symmetric tree – Asked in: Infosys
-
Binary tree from inorder & preorder – Asked in: IBM
-
Lowest common ancestor in binary tree – Asked in: Capgemini
-
Max depth of binary tree – Asked in: TCS
-
Sum root to leaf numbers – Asked in: Infosys
-
Path sum – Asked in: Wipro
-
Binary tree level order traversal – Asked in: Accenture
-
Convert binary tree to doubly linked list – Asked in: Capgemini
-
Serialize and deserialize binary tree – Asked in: Infosys
-
Check subtree of another tree – Asked in: TCS
-
Construct tree from postorder and inorder – Asked in: Capgemini
-
Flatten binary tree to linked list – Asked in: Wipro
-
Find all duplicates in array – Asked in: Infosys
-
Find first and last position of element – Asked in: TCS
-
Count number of subarrays with sum k – Asked in: Capgemini
-
Find pivot index – Asked in: Cognizant
-
Max consecutive ones – Asked in: Wipro
-
Missing number – Asked in: Accenture
-
Min size subarray sum – Asked in: Infosys
-
Find all numbers disappeared – Asked in: TCS
-
Minimum operations to make array equal – Asked in: IBM
-
Merge two sorted arrays – Asked in: Capgemini
-
Check array is sorted and rotated – Asked in: Wipro
-
Best time to buy and sell stock – Asked in: Infosys
-
Subarray product less than k – Asked in: Accenture
-
Find target indices after sorting – Asked in: TCS
-
Rearrange array elements by sign – Asked in: Wipro
-
Maximum average subarray I – Asked in: Capgemini
-
Find kth positive missing number – Asked in: Infosys
-
Number of good pairs – Asked in: Cognizant
-
Intersection of two arrays – Asked in: IBM
-
Relative sort array – Asked in: Capgemini
-
Check if number is power of two – Asked in: Wipro
-
Single number – Asked in: TCS
-
Hamming weight – Asked in: Infosys
-
Count set bits – Asked in: Accenture
-
Find XOR of numbers from 1 to n – Asked in: IBM
-
Sum of two integers without + - – Asked in: Capgemini
-
Reverse bits – Asked in: Wipro
-
Add binary – Asked in: Infosys
-
Bitwise AND of numbers range – Asked in: TCS
-
Find missing number using XOR – Asked in: Accenture
-
Subsets – Asked in: Wipro
-
Permutations – Asked in: Infosys
-
Combination sum – Asked in: Capgemini
-
Word search – Asked in: TCS
-
N queens – Asked in: IBM
-
Palindrome partitioning – Asked in: Accenture
-
Letter case permutation – Asked in: Cognizant
-
Generate parentheses – Asked in: Infosys
-
Sudoku solver – Asked in: Wipro
-
Restore IP addresses – Asked in: TCS
-
Gray code – Asked in: Capgemini
-
Combination sum II – Asked in: Infosys
-
Combinations – Asked in: Wipro
-
Subsets II – Asked in: Accenture
-
Path sum II – Asked in: TCS
-
Letter combinations of a phone number – Asked in: Capgemini
-
Permutations II – Asked in: Infosys
-
Word break – Asked in: Wipro
-
Palindrome partitioning II – Asked in: IBM
-
Minimum number of swaps to make string balanced – Asked in: Cognizant
...
-
Validate Binary Search Tree – Asked in: Infosys
-
Lowest Common Ancestor of a BST – Asked in: Wipro
-
Binary Tree Inorder Traversal – Asked in: TCS
-
Construct Binary Tree from Inorder and Preorder – Asked in: Capgemini
-
Populating Next Right Pointers – Asked in: IBM
-
Flatten a Multilevel Doubly Linked List – Asked in: Infosys
-
Insert into a Binary Search Tree – Asked in: Cognizant
-
Sum of Left Leaves – Asked in: Wipro
-
Maximum Depth of N-ary Tree – Asked in: Accenture
-
Convert Sorted Array to BST – Asked in: TCS
-
Construct String from Binary Tree – Asked in: Infosys
-
Average of Levels in Binary Tree – Asked in: Capgemini
-
Binary Tree Tilt – Asked in: Wipro
-
Path Sum III – Asked in: Cognizant
-
Find Duplicate Subtrees – Asked in: Accenture
-
Construct Binary Tree from String – Asked in: IBM
-
Binary Tree Cameras – Asked in: TCS
-
Binary Tree Coloring Game – Asked in: Infosys
-
All Nodes Distance K in Binary Tree – Asked in: Capgemini
-
Recover Binary Search Tree – Asked in: Wipro
-
Boundary of Binary Tree – Asked in: Cognizant
-
Binary Tree Right Side View – Asked in: Infosys
-
Same Tree – Asked in: Capgemini
-
Count Complete Tree Nodes – Asked in: TCS
-
Binary Tree Paths – Asked in: IBM
-
Sum of Nodes with Even-Valued Grandparent – Asked in: Accenture
-
Longest ZigZag Path in Binary Tree – Asked in: Wipro
-
Tree Diameter – Asked in: Infosys
-
Count Good Nodes in Binary Tree – Asked in: Capgemini
-
Binary Search Tree Iterator – Asked in: Cognizant
-
Serialize and Deserialize BST – Asked in: IBM
-
Delete Node in a BST – Asked in: Wipro
-
Kth Smallest Element in BST – Asked in: Infosys
-
Validate Stack Sequences – Asked in: Capgemini
-
Check Completeness of a Binary Tree – Asked in: TCS
-
Maximum Width of Binary Tree – Asked in: Accenture
-
Find Largest Value in Each Tree Row – Asked in: Wipro
-
Cousins in Binary Tree – Asked in: Infosys
-
Vertical Order Traversal – Asked in: Cognizant
-
Binary Tree Postorder Traversal – Asked in: Capgemini
-
Sum of Root To Leaf Binary Numbers – Asked in: Wipro
-
Delete Leaves with a Given Value – Asked in: Infosys
-
Longest Univalue Path – Asked in: TCS
-
Find Bottom Left Tree Value – Asked in: IBM
-
Flip Equivalent Binary Trees – Asked in: Accenture
-
All Elements in Two BSTs – Asked in: Cognizant
-
Merge Two Binary Trees – Asked in: Capgemini
-
Binary Tree Level Order Traversal II – Asked in: Wipro
-
Path In Zigzag Labelled Binary Tree – Asked in: Infosys
-
Sum of Distances in Tree – Asked in: TCS