TCS Array Coding Interview Questions
74 array coding problems are tagged as asked at TCS in interviews and online assessments reported by candidates. By difficulty they split into 31 basic, 35 intermediate and 8 advanced. The topics they most often combine with are Sorting, Hash Table, Sliding Window, Prefix Sum.
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
- Two Sum (Basic)
- Contains Duplicate (Basic)
- Best Time to Buy and Sell Stock (Basic)
- Maximum Subarray (Intermediate)
- Product of Array Except Self (Intermediate)
- Move Zeroes (Basic)
- Search Insert Position (Basic)
- Rotate Array (Intermediate)
- House Robber (Intermediate)
- Longest Increasing Subsequence (Advanced)
- Single Number (Basic)
- Majority Element (Basic)
- Missing Number (Basic)
- Two Sum in a Sorted Array (Basic)
- Minimum Size Subarray Sum (Intermediate)
- Longest Consecutive Sequence (Intermediate)
- Subarray Sum Equals K (Intermediate)
- Container With Most Water (Intermediate)
- Trapping Rain Water (Advanced)
- Sort Colors (Basic)
- Remove Element (Basic)
- Third Maximum Number (Basic)
- Max Consecutive Ones (Basic)
- Find Pivot Index (Basic)
- Running Sum of Array (Basic)
- Squares of a Sorted Array (Basic)
- Largest Rectangle in Histogram (Advanced)
- Daily Temperatures (Intermediate)
- Min Cost Climbing Stairs (Intermediate)
- Plus One (Basic)
- Sort Array by Parity (Basic)
- Search in a Rotated Sorted Array (Advanced)
- Minimum in a Rotated Sorted Array (Intermediate)
- Peak Index in a Mountain Array (Intermediate)
- Find All Missing Numbers (Basic)
- Merge Intervals (Intermediate)
- Insert an Interval (Intermediate)
- Fruit Into Two Baskets (Intermediate)
- Subarrays With Product Less Than K (Intermediate)
- Maximum Product of Three (Basic)
- Count Numbers With Even Digits (Basic)
- Maximum Ice Cream Bars (Basic)
- 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)
- Single Number (Basic)
- LRU Cache Operations (Basic)
- Burst Balloons (Advanced)
- Tallest Billboard (Advanced)
- Min Stack Operations (Basic)
- Asteroid Collision (Intermediate)
- Jump Game II (Intermediate)
- Assign Cookies (Basic)
- Lemonade Change (Basic)
- Find All Duplicates in an Array (Intermediate)
- Majority Element II (Intermediate)
- Rank Transform of an Array (Basic)
- 3Sum Triplets (Intermediate)
- 3Sum Closest (Intermediate)
- Sliding Window Maximum Values (Advanced)
- Find First and Last Position (Intermediate)
- Single Element in a Sorted Array (Intermediate)
- Median of Two Sorted Arrays (Advanced)
- Search in Rotated Sorted Array II (Intermediate)
- Check if Array Is Sorted and Rotated (Basic)
- Maximum Ascending Subarray Sum (Basic)
- Smaller Numbers Than Current (Basic)
- Count the Number of Fair Pairs (Intermediate)
- Bitwise ORs of Subarrays (Intermediate)
Related
- TCS coding interview questions
- Array problems
- TCS basic problems
- TCS intermediate problems
- TCS advanced problems
- Company interview roadmaps
- All interview guides
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.