tcs coding interview
questions, leaked.
130 problems reported across recent tcs interviews. Top patterns: array, math, string. The list below is what most candidates actually saw, plus the honest play if you can't grind all of it.
TCS pulls from a pool of 130 problems, most of them easy to medium. Arrays dominate their interview, appearing in 71 problems. You'll see two-pointers, hash tables, and dynamic programming stacked on top of arrays repeatedly. Math and string problems fill the gaps. The good news: 67 of the 130 are easy, so speed and pattern recognition matter more than grinding obscure problems. The risky part: you'll face an array problem under time pressure, and if you freeze on subarray logic or prefix sums, the interview stalls. That's where StealthCoder acts as your invisible backstop on the live assessment, solving it in seconds so you stay in the round.
Top problems at tcs
| # | Problem | Diff | Frequency | Pass % | Patterns |
|---|---|---|---|---|---|
| 01 | Two Sum | EASY | 84.5 | 56% | Array · Hash Table |
| 02 | Palindrome Number | EASY | 76.6 | 59% | Math |
| 03 | Majority Element | EASY | 72.2 | 66% | Array · Hash Table · Divide and Conquer |
| 04 | Best Time to Buy and Sell Stock | EASY | 68.6 | 55% | Array · Dynamic Programming |
| 05 | Maximum Subarray | MEDIUM | 66.5 | 52% | Array · Divide and Conquer · Dynamic Programming |
| 06 | Longest Common Prefix | EASY | 64.1 | 45% | String · Trie |
| 07 | Subarray Sum Equals K | MEDIUM | 61.4 | 45% | Array · Hash Table · Prefix Sum |
| 08 | Move Zeroes | EASY | 61.4 | 63% | Array · Two Pointers |
| 09 | Rotate Array | MEDIUM | 61.4 | 43% | Array · Math · Two Pointers |
| 10 | Valid Parentheses | EASY | 61.4 | 42% | String · Stack |
| 11 | Fibonacci Number | EASY | 61.4 | 73% | Math · Dynamic Programming · Recursion |
| 12 | Reverse Integer | MEDIUM | 59.9 | 30% | Math |
| 13 | Jump Game | MEDIUM | 59.9 | 39% | Array · Dynamic Programming · Greedy |
| 14 | Count the Digits That Divide a Number | EASY | 59.9 | 86% | Math |
| 15 | Maximum Ascending Subarray Sum | EASY | 59.9 | 66% | Array |
| 16 | Valid Anagram | EASY | 56.4 | 67% | Hash Table · String · Sorting |
| 17 | Single Number | EASY | 56.4 | 76% | Array · Bit Manipulation |
| 18 | Roman to Integer | EASY | 56.4 | 65% | Hash Table · Math · String |
| 19 | Unique Paths | MEDIUM | 56.4 | 66% | Math · Dynamic Programming · Combinatorics |
| 20 | Merge Sorted Array | EASY | 56.4 | 53% | Array · Two Pointers · Sorting |
| 21 | Remove Letter To Equalize Frequency | EASY | 56.4 | 18% | Hash Table · String · Counting |
| 22 | Minimum Cuts to Divide a Circle | EASY | 56.4 | 55% | Math · Geometry |
| 23 | Minimum Operations to Exceed Threshold Value I | EASY | 56.4 | 86% | Array |
| 24 | Minimum Operations to Exceed Threshold Value II | MEDIUM | 56.4 | 46% | Array · Heap (Priority Queue) · Simulation |
| 25 | Palindrome Partitioning IV | HARD | 56.4 | 45% | String · Dynamic Programming |
| 26 | Find the Index of the First Occurrence in a String | EASY | 54.4 | 45% | Two Pointers · String · String Matching |
| 27 | Bitwise ORs of Subarrays | MEDIUM | 54.4 | 41% | Array · Dynamic Programming · Bit Manipulation |
| 28 | Climbing Stairs | EASY | 54.4 | 54% | Math · Dynamic Programming · Memoization |
| 29 | 3Sum | MEDIUM | 54.4 | 37% | Array · Two Pointers · Sorting |
| 30 | Remove Duplicates from Sorted Array | EASY | 52.2 | 60% | Array · Two Pointers |
| 31 | Longest Palindromic Substring | MEDIUM | 52.2 | 36% | Two Pointers · String · Dynamic Programming |
| 32 | Pow(x, n) | MEDIUM | 49.7 | 37% | Math · Recursion |
| 33 | Second Highest Salary | MEDIUM | 49.7 | 44% | Database |
| 34 | Sort Colors | MEDIUM | 49.7 | 68% | Array · Two Pointers · Sorting |
| 35 | Plus One | EASY | 49.7 | 48% | Array · Math |
| 36 | Length of Last Word | EASY | 49.7 | 56% | String |
| 37 | Container With Most Water | MEDIUM | 49.7 | 58% | Array · Two Pointers · Greedy |
| 38 | Spiral Matrix | MEDIUM | 46.8 | 54% | Array · Matrix · Simulation |
| 39 | Trapping Rain Water | HARD | 46.8 | 65% | Array · Two Pointers · Dynamic Programming |
| 40 | Contains Duplicate | EASY | 46.8 | 63% | Array · Hash Table · Sorting |
| 41 | Happy Number | EASY | 46.8 | 58% | Hash Table · Math · Two Pointers |
| 42 | Reverse Words in a String | MEDIUM | 46.8 | 52% | Two Pointers · String |
| 43 | Sliding Window Maximum | HARD | 46.8 | 48% | Array · Queue · Sliding Window |
| 44 | Missing Number | EASY | 46.8 | 70% | Array · Hash Table · Math |
| 45 | Best Time to Buy and Sell Stock II | MEDIUM | 43.4 | 70% | Array · Dynamic Programming · Greedy |
| 46 | Set Matrix Zeroes | MEDIUM | 43.4 | 61% | Array · Hash Table · Matrix |
| 47 | Longest Substring Without Repeating Characters | MEDIUM | 43.4 | 37% | Hash Table · String · Sliding Window |
| 48 | Max Consecutive Ones III | MEDIUM | 43.4 | 66% | Array · Binary Search · Sliding Window |
| 49 | Add Two Numbers | MEDIUM | 43.4 | 46% | Linked List · Math · Recursion |
| 50 | Toeplitz Matrix | EASY | 43.4 | 69% | Array · Matrix |
Frequencies derived from public community-tagged interview reports. Click a row to view on LeetCode.
You have a week, maybe less. You can't out-grind the list above. StealthCoder runs invisibly during the actual tcs OA. The proctor cannot see it. Screen share cannot detect it. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.
Get StealthCoder- array71 · 55%
- math28 · 22%
- string26 · 20%
- dynamic programming24 · 18%
- two pointers24 · 18%
- hash table21 · 16%
- sorting17 · 13%
- binary search12 · 9%
- database10 · 8%
- matrix8 · 6%
Array problems are the spine of TCS interviews. Two Sum, Majority Element, Maximum Subarray, Rotate Array, and Subarray Sum Equals K all test the same core skill: iteration with hash tables or pointers to cut time complexity. Math rounds out 28 problems, mostly single-digit arithmetic and number properties (Palindrome Number, Fibonacci, digit division). Strings are lighter (26 problems) but non-negotiable. Dynamic programming appears in 24 problems, often layered onto arrays (Jump Game, Maximum Subarray). Prepare arrays first, get comfortable with prefix sums and two-pointer manipulation, then lock in hash-table lookups. Binary search, bit manipulation, and recursion are lower frequency but show up late in rounds. If you blank on a subarray pattern mid-OA, StealthCoder surfaces the solution invisibly while you stay calm and move forward.
Companies with similar patterns
If you prepped for tcs, these companies recycle ~60% of the same topics.
You've seen the list.
Now make sure you pass tcs.
Memorizing every problem above in a week is a fantasy. StealthCoder is the hedge: an AI overlay that's invisible during screen share. It reads the problem on screen and surfaces a working solution in under 2 seconds. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.
tcs interview FAQ
How many array problems should I solve before the TCS interview?+
Array problems account for 71 of 130 TCS problems. Solve Two Sum, Majority Element, Maximum Subarray, Rotate Array, and Move Zeroes first. These five cover the core patterns. Then practice Subarray Sum Equals K and Jump Game to get comfortable with prefix sums and DP overlays on arrays.
Is math enough to prep for TCS, or do I need to drill strings too?+
Math is 21 percent of the pool, strings 20 percent. Both matter equally. Palindrome Number, Fibonacci, and digit problems are common. But you can't ignore Valid Parentheses and Longest Common Prefix. Spend 30 percent of prep time on math, 25 percent on strings, the rest on arrays and two-pointers.
Should I study dynamic programming early or late for TCS?+
DP appears in 24 problems, usually combined with arrays. Don't isolate it. Learn DP through array problems: Best Time to Buy and Sell Stock, Maximum Subarray, Jump Game. Once you're solid on array iteration, DP becomes the optimization layer, not a separate skill.
What's the hardest topic I'll see in a TCS interview?+
Only 9 of 130 problems are hard. Bit manipulation, recursion, and matrix problems are the lowest frequency. If you hit one, it's a bonus round. Prepare them last. The interview is won on medium-difficulty arrays and hash-table problems, not rare edge cases.
Can I pass TCS by only solving easy problems?+
67 of 130 are easy, but most OAs mix difficulty. You'll face easy problems in rounds one and two, medium in round three. Two Sum, Move Zeroes, Valid Parentheses are safe easy wins. Practice five to seven medium problems (Rotate Array, Reverse Integer, Maximum Subarray) to handle the jump.