TCS interview questions¶
The most frequent LeetCode problems tagged to TCS. This is a data-only page. For process and behavioral prep, use the coding guide and behavioral guide.
Based on 98 distinct problems tagged to TCS in the last 6 months (36 in the last 30 days, 65 in the last 3 months, 243 all-time) across two open datasets of LeetCode company tags. Tags are user-reported, so treat frequency as a signal, not a promise.
Difficulty mix (last 6 months): Medium 49%, Easy 45%, Hard 6%
Most tagged topics (share of problems): Array 65%, Hash Table 26%, String 20%, Two Pointers 19%, Sorting 18%, Math 15%, Dynamic Programming 11%, Binary Search 10%, Recursion 8%, Stack 8%
Most frequent problems¶
Ranked by frequency, weighted toward the last 30 days. Classics like Two Sum sit near the top of almost every company's list because users tag them everywhere. Solve those fast. The signature list below is more specific to this company.
| # | Problem | Difficulty | Last seen | Topics |
|---|---|---|---|---|
| 1 | Container With Most Water | Medium | 30 days | Array, Two Pointers, Greedy |
| 2 | First Missing Positive | Hard | 30 days | Array, Hash Table |
| 3 | Two Sum | Easy | 30 days | Array, Hash Table |
| 4 | Rank Transform of an Array | Easy | 30 days | Array, Hash Table, Sorting |
| 5 | Integer to Roman | Medium | 30 days | Hash Table, Math, String |
| 6 | Roman to Integer | Easy | 30 days | Hash Table, Math, String |
| 7 | Longest Palindromic Substring | Medium | 30 days | Two Pointers, String, Dynamic Programming, Manacher |
| 8 | Fibonacci Number | Easy | 30 days | Math, Dynamic Programming, Recursion, Memoization |
| 9 | First Unique Character in a String | Easy | 30 days | Hash Table, String, Queue, Counting |
| 10 | Palindrome Number | Easy | 30 days | Math |
| 11 | Merge Sorted Array | Easy | 30 days | Array, Two Pointers, Sorting |
| 12 | Remove Duplicates from Sorted Array | Easy | 30 days | Array, Two Pointers |
| 13 | Longest Consecutive Sequence | Medium | 30 days | Array, Hash Table, Union-Find |
| 14 | Longest Substring Without Repeating Characters | Medium | 30 days | Hash Table, String, Sliding Window |
| 15 | Largest Rectangle in Histogram | Hard | 30 days | Array, Stack, Monotonic Stack, Range Minimum/Maximum Query |
| 16 | Rotate Array | Medium | 30 days | Array, Math, Two Pointers |
| 17 | Valid Anagram | Easy | 30 days | Hash Table, String, Sorting |
| 18 | Contains Duplicate II | Easy | 30 days | Array, Hash Table, Sliding Window |
| 19 | Kth Smallest Element in a BST | Medium | 30 days | Tree, Depth-First Search, Binary Search Tree, Binary Tree |
| 20 | Sort Colors | Medium | 30 days | Array, Two Pointers, Sorting, Quicksort |
| 21 | Maximum Product of Three Numbers | Easy | 30 days | Array, Math, Sorting |
| 22 | Best Time to Buy and Sell Stock | Easy | 30 days | Array, Dynamic Programming |
| 23 | Reverse String | Easy | 30 days | Two Pointers, String |
| 24 | Group Anagrams | Medium | 30 days | Array, Hash Table, String, Sorting |
| 25 | Maximum Average Subarray I | Easy | 30 days | Array, Sliding Window |
| 26 | Two Sum II - Input Array Is Sorted | Medium | 30 days | Array, Two Pointers, Binary Search |
| 27 | Palindrome Linked List | Easy | 30 days | Linked List, Two Pointers, Stack, Recursion |
| 28 | Search Insert Position | Easy | 30 days | Array, Binary Search |
| 29 | Find Peak Element | Medium | 30 days | Array, Binary Search |
| 30 | Find Missing Elements | Easy | 30 days | Array, Hash Table, Sorting |
| 31 | Find the Peaks | Easy | 30 days | Array, Enumeration |
| 32 | Permutation in String | Medium | 30 days | Hash Table, Two Pointers, String, Sliding Window |
| 33 | Valid Palindrome | Easy | 30 days | Two Pointers, String |
| 34 | Top K Frequent Words | Medium | 30 days | Array, Hash Table, String, Trie |
| 35 | Peak Index in a Mountain Array | Medium | 30 days | Array, Binary Search, Ternary Search |
| 36 | Maximum Subarray | Medium | 3 months | Array, Divide and Conquer, Dynamic Programming |
| 37 | Minimum Number of Operations to Reinitialize a Permutation | Medium | 30 days | Array, Math, Simulation |
| 38 | Toeplitz Matrix | Easy | 3 months | Array, Matrix |
| 39 | Move Zeroes | Easy | 3 months | Array, Two Pointers |
| 40 | Longest Common Prefix | Easy | 3 months | Array, String, Trie |
Signature problems¶
Problems where TCS accounts for a large share of all recent tags across companies. These are the most TCS-specific questions in the data.
| # | Problem | Difficulty | Last seen | Topics |
|---|---|---|---|---|
| 1 | First Missing Positive | Hard | 30 days | Array, Hash Table |
| 2 | Rank Transform of an Array | Easy | 30 days | Array, Hash Table, Sorting |
| 3 | Toeplitz Matrix | Easy | 3 months | Array, Matrix |
| 4 | Find Missing Elements | Easy | 30 days | Array, Hash Table, Sorting |
| 5 | Find the Peaks | Easy | 30 days | Array, Enumeration |
| 6 | Maximum Total Subarray Value I | Medium | 3 months | Array, Greedy |
| 7 | Minimum Number of Operations to Reinitialize a Permutation | Medium | 30 days | Array, Math, Simulation |
| 8 | Minimum Depth of Binary Tree | Easy | 3 months | Tree, Depth-First Search, Breadth-First Search, Binary Tree |
| 9 | Maximum Ice Cream Bars | Medium | 3 months | Array, Greedy, Sorting, Counting Sort |
| 10 | Smallest Range Covering Elements from K Lists | Hard | 3 months | Array, Hash Table, Greedy, Sliding Window |
| 11 | Count Odd Numbers in an Interval Range | Easy | 6 months | Math |
Sources¶
- liquidslr/leetcode-company-wise-problems and snehasishroy/leetcode-companywise-interview-questions, merged by scripts/build_question_data.py.
Next: More companies