0 day streak

TCS coding interview questions

Service and IT India

Ranked by how often candidates report them. Each opens in the editor with hidden tests, an animated walkthrough and solutions in four languages; a question you solve once counts for every company that asks it.

0%ready
ProgressTitleDifficultyTopicHow often hereAlso asked atNext step
Two SumTwo Sum Easy Arrays & Hashing Google, Amazon, Microsoft +46 Solve
Longest Palindromic SubstringStrings Medium Dynamic Programming Amazon, Microsoft, Apple +22 Solve
Palindrome NumberMath / Number Theory Easy Arrays & Hashing Bloomberg, Morgan Stanley, Qualcomm +10 Solve
Kadane's Algorithm - SimpleKadane's Algorithm Medium Arrays & Hashing Microsoft, Apple, LinkedIn +29 Solve
Move ZeroesTwo Pointer Easy Arrays & Hashing Meta, Nvidia, Bloomberg +11 Solve
Longest Substring Without Repeating CharactersSliding Window · Variable Medium Arrays & Hashing Google, Amazon, Microsoft +50 Solve
Reverse IntegerMath / Number Theory Medium Arrays & Hashing Bloomberg, Barclays, Wipro +4 Solve
Container With Most WaterTwo Pointer Medium Arrays & Hashing Google, Microsoft, Apple +31 Solve
Longest Common PrefixString Basics Easy Arrays & Hashing Bloomberg, Adobe, Visa +12 Solve
3SumTwo Sum Medium Arrays & Hashing Google, Microsoft, Meta +31 Solve
Remove Duplicates from Sorted ArrayTwo Pointer Easy Arrays & Hashing Microsoft, Bloomberg, Cisco +8 Solve
Valid ParenthesesStack Basics Easy Stack Google, Microsoft, Meta +39 Solve
Jump GameGreedy Medium Arrays & Hashing Apple, DoorDash, Adobe +5 Solve
Sort ColorsDutch National Flag Medium Arrays & Hashing Microsoft, Nvidia, Morgan Stanley +12 Solve
Best Time to Buy and Sell StockState Machine DP - Stock Problems Easy Dynamic Programming Amazon, Microsoft, Apple +38 Solve
Single NumberMissing / Repeated Numbers Easy Bit Manipulation Airbnb, Bloomberg, Palantir +6 Solve
Majority ElementMoore's Voting Algorithm Easy Arrays & Hashing Bloomberg, Qualcomm, Deloitte +3 Solve
Rotate ArrayDouble Reversal Trick Medium Arrays & Hashing Apple, Bloomberg, Samsung +8 Solve
Contains DuplicateHash Set Lookup Easy Arrays & Hashing Netflix, Airbnb, Spotify +3 Solve
Valid AnagramHashing Easy Arrays & Hashing Netflix, Databricks, Bloomberg +13 Solve
Reverse StringTwo Pointer Easy Arrays & Hashing Samsung, Qualcomm, Intel +3 Solve
Subarray Sum Equals KPrefix Sum Strategy Medium Arrays & Hashing Google, Microsoft, Meta +15 Solve
Fibonacci Number1D DP Easy Dynamic Programming Spotify, Intel, Deloitte +7 Solve
Median of Two Sorted ArraysBinary Search on Partition Hard Binary Search Google, Amazon, Microsoft +17 Solve
Add Two NumbersDummy Node Pattern Medium Linked List Amazon, Microsoft, Meta +12 Solve
Roman to IntegerRight to Left Traversal Easy Arrays & Hashing Bloomberg, Oracle, JPMorgan Chase +8 Solve
Find First and Last Position of Element in Sorted ArrayBisect Medium Binary Search LinkedIn, Bloomberg, Pinterest +7 Solve
Trapping Rain WaterTwo Pointer Hard Arrays & Hashing Google, Amazon, Microsoft +38 Solve
Pow(x, n) (Binary Exponentiation)Search on Answer Range Medium Binary Search LinkedIn, ServiceNow, Qualcomm +2 Solve
Spiral MatrixMatrix Traversal Medium Arrays & Hashing Microsoft, Apple, Databricks +15 Solve
Climbing Stairs1D DP Easy Dynamic Programming Bloomberg, Intuit, Qualcomm +8 Solve
Merge Sorted ArrayTwo Pointer Easy Arrays & Hashing Meta, Apple, Nvidia +12 Solve
Missing NumberMissing / Repeated Numbers Easy Bit Manipulation Microsoft, Nvidia, Palantir +6 Solve
First Unique Character in a StringHashing Easy Arrays & Hashing Databricks, Nutanix, Goldman Sachs +8 Solve
Valid PalindromeTwo Pointer Easy Arrays & Hashing Microsoft, Apple, Bloomberg +7 Solve
Group AnagramsHashing Medium Arrays & Hashing Amazon, Microsoft, Meta +31 Solve
Backspace String CompareTwo Pointer Easy Arrays & Hashing Amazon, Wells Fargo, Myntra Solve
Design Linked ListLinked Lists Medium Design Data Structures Airtel Solve
Also reported, being added to AlgoRung (2)

Closest Dessert Cost · Check if the Sentence Is Pangram

Questions people ask

What coding questions does TCS ask most?

Two Sum, Longest Palindromic Substring, Palindrome Number, Kadane's Algorithm - Simple, Move Zeroes, Longest Substring Without Repeating Characters, Reverse Integer, Container With Most Water.

Which topics come up in TCS coding rounds?

arrays, strings, math, two pointers, linked list, dynamic programming.

How hard are TCS coding questions?

Of the reported questions, 20 are easy, 16 medium and 2 hard. A 45 to 60 minute live interview where you solve one or two data-structures-and-algorithms problems while explaining your thinking. Interviewers score problem solving, code quality, testing and communication.