All company sheets
TCS DSA interview questions
47 problems to practise before your TCS online test or coding round. Most widely asked first.
47
Questions
12
Easy
35
Medium
0
Hard
Good practice. Problems at the level of this company’s online test and coding round. Treat it as a practice set, not a leak. These are Astra’s own tags, not an official question list.
TCS is hiring · 10 open roles on Astra right nowView roles47 questions
- 1
Best Time to Buy and Sell Stock
EasyArrayTagged at 7 companies - 2
Implement Standard Binary Search Iteratively
EasyBinary SearchTagged at 7 companies - 3
Sort an Array of Squares of a Sorted Array
EasyArrayTagged at 7 companies - 4
Find the K-th Row of Pascal's Triangle (O(k) Space)
EasyArrayTagged at 7 companies - 5
Find the Maximum Number of Consecutive Ones
EasyArrayTagged at 7 companies - 6
Find the Richest Customer's Wealth (Matrix)
EasyArrayTagged at 7 companies - 7
Reverse String
EasyTwo PointersTagged at 7 companies - 8
Product of Array Except Self
MediumArrayTagged at 7 companies - 9
Spiral Matrix
MediumArrayTagged at 7 companies - 10
Find All Combinations that Sum to a Target
MediumRecursionTagged at 7 companies - 11
Search a 2D Matrix (Sorted Rows and Columns)
MediumBinary SearchTagged at 7 companies - 12
Search in a Nearly Sorted Array
MediumBinary SearchTagged at 7 companies - 13
Implement Python's bisect_left (Lower Bound)
MediumBinary SearchTagged at 7 companies - 14
Find All Unique Triplets That Sum to Zero (3Sum)
MediumArrayTagged at 7 companies - 15
Implement the Coin Change Problem (Minimum Coins)
MediumArrayTagged at 7 companies - 16
Find Minimum Number of Arrows to Burst Balloons
MediumArrayTagged at 7 companies - 17
Find All Non-overlapping Intervals (Minimum Erasures)
MediumArrayTagged at 7 companies - 18
Solve the House Robber Problem (DP)
MediumArrayTagged at 7 companies - 19
Password Strength Validator
MediumSliding WindowTagged at 7 companies - 20
Find K-Length Substrings With No Repeated Characters
MediumSliding WindowTagged at 7 companies - 21
Minimum Swaps to Group All 1's Together
MediumSliding WindowTagged at 7 companies - 22
Grumpy Bookstore Owner
MediumSliding WindowTagged at 7 companies - 23
4Sum
MediumTwo PointersTagged at 7 companies - 24
Check if a Linked List is a Palindrome
EasyLinkedListTagged at 6 companies - 25
Find the N/k-th Node in a Linked List (Fractional Node)
EasyLinkedListTagged at 6 companies - 26
Find the Point of Intersection of Two Lists (Length Method)
EasyLinkedListTagged at 6 companies - 27
Find the Maximum Depth of an N-ary Tree
EasyTreeTagged at 6 companies - 28
Find the Longest Common Prefix (Vertical Scanning)
EasyStringTagged at 6 companies - 29
Calculate the Sum of All Subarray Minimums
MediumStack and QueueTagged at 6 companies - 30
Find the Shortest Unsorted Continuous Subarray
MediumStack and QueueTagged at 6 companies - 31
Find the Most Competitive Subsequence of Size K
MediumStack and QueueTagged at 6 companies - 32
Remove Nth Node From End of The List
MediumLinkedListTagged at 6 companies - 33
Design a Singly Linked List Implementation
MediumLinkedListTagged at 6 companies - 34
Reverse a Linked List Sub-list (from m to n)
MediumLinkedListTagged at 6 companies - 35
Split a Linked List in k Consecutive Parts
MediumLinkedListTagged at 6 companies - 36
Copy List with Random Pointer (O(1) Space)
MediumLinkedListTagged at 6 companies - 37
Find Triplet with a Given Sum in a Doubly Linked List
MediumLinkedListTagged at 6 companies - 38
Find the Diameter of an N-ary Tree
MediumTreeTagged at 6 companies - 39
Implement a Binary Tree Zigzag Level Order Traversal
MediumTreeTagged at 6 companies - 40
Find the Lowest Common Ancestor of a Binary Tree (Parent Pointers)
MediumTreeTagged at 6 companies - 41
Find the Index of the First Occurrence (strStr)
MediumStringTagged at 6 companies - 42
Implement Basic Calculator II with +, -, *, /
MediumStringTagged at 6 companies - 43
Find the Longest Common Substring (DP)
MediumStringTagged at 6 companies - 44
Determine if Two Strings are 'Close' Strings
MediumStringTagged at 6 companies - 45
Find All Palindromic Decompositions of a String
MediumStringTagged at 6 companies - 46
Airbnb Booking Calendar Overlap
MediumIntervalsTagged at 6 companies - 47
Ad Server Campaign Injection
MediumIntervalsTagged at 6 companies