TCS Intermediate Coding Interview Questions
60 intermediate coding problems are tagged as asked at TCS in interviews and online assessments reported by candidates. By difficulty they split into 0 basic, 60 intermediate and 0 advanced. The topics they most often combine with are Array, String, Sorting, Math.
Reported questions change over time and are not a guarantee of what you will be asked, so use the list to see which patterns TCS tends to test. For each problem, practise explaining your approach, its time and space cost and the edge cases before you write the code; every problem opens in an editor that runs your code against test cases.
Coding problems
- Maximum Subarray (Intermediate)
- Longest Substring Without Repeats (Intermediate)
- Product of Array Except Self (Intermediate)
- Rotate Array (Intermediate)
- House Robber (Intermediate)
- Minimum Size Subarray Sum (Intermediate)
- Longest Consecutive Sequence (Intermediate)
- Subarray Sum Equals K (Intermediate)
- Container With Most Water (Intermediate)
- Longest Palindromic Substring (Intermediate)
- Happy Number (Intermediate)
- Daily Temperatures (Intermediate)
- Repeated Substring Pattern (Intermediate)
- Count and Say (Intermediate)
- Integer to Roman (Intermediate)
- Roman to Integer (Intermediate)
- Count Primes (Intermediate)
- Min Cost Climbing Stairs (Intermediate)
- Reverse Integer (Intermediate)
- Minimum in a Rotated Sorted Array (Intermediate)
- Peak Index in a Mountain Array (Intermediate)
- Merge Intervals (Intermediate)
- Insert an Interval (Intermediate)
- Permutation Inside a String (Intermediate)
- Fruit Into Two Baskets (Intermediate)
- Subarrays With Product Less Than K (Intermediate)
- Zigzag Conversion (Intermediate)
- Maximum Gap After Sorting (Intermediate)
- Maximum Product Subarray (Intermediate)
- Subarray Sum Equals K (Intermediate)
- Partition Equal Subset Sum (Intermediate)
- Best Time to Buy and Sell Stock II (Intermediate)
- Next Permutation (Intermediate)
- Container With Most Water (Intermediate)
- Top K Frequent Values (Intermediate)
- Longest Palindromic Subsequence (Intermediate)
- Tree Vertical Traversal (Intermediate)
- Remove Nth Node From End (Intermediate)
- Odd Even Linked List (Intermediate)
- Reorder Linked List (Intermediate)
- Kth Smallest Value in a BST (Intermediate)
- Distribute Coins in Binary Tree (Intermediate)
- Rotting Oranges (Intermediate)
- String to Integer (Intermediate)
- Asteroid Collision (Intermediate)
- Task Scheduler (Intermediate)
- Jump Game II (Intermediate)
- Find All Duplicates in an Array (Intermediate)
- Rotate Image (Intermediate)
- Majority Element II (Intermediate)
- 3Sum Triplets (Intermediate)
- 3Sum Closest (Intermediate)
- Find First and Last Position (Intermediate)
- Search a 2D Matrix (Intermediate)
- Single Element in a Sorted Array (Intermediate)
- Search in Rotated Sorted Array II (Intermediate)
- Bulb Switcher (Intermediate)
- Letter Combinations of a Phone Number (Intermediate)
- Count the Number of Fair Pairs (Intermediate)
- Bitwise ORs of Subarrays (Intermediate)
Related
Frequently asked questions
How should I use the TCS problem list?
Start with the basic problems, then the intermediate and advanced ones, and note which topics repeat. Solve each under a timer, then read the explanation.
Are these the exact TCS interview questions?
They are problems candidates reported being asked. Companies rotate questions, so use them to learn the patterns, not to predict the exact question.