Now practice all your interviews before giving the real one

( TCS interview questions )

TCS interview questions, and how to answer them.

15 questions candidates report from TCS interviews, grouped by topic, with a short note on how to answer each kind. Then say your answers out loud in a practice interview.

5 minutes, no CV needed. A practice round, not TCS's own.

What TCS interviews ask, in our data

Our bank holds 151 coding questions that candidates report from TCS interviews. The topics that come up most: arrays & hashing (41), math & bits (23), two pointers (12) and binary search (11). Of the 151 coding questions, 56 are easy, 83 medium and 12 hard.

Our data covers coding questions for TCS; it says nothing about their other rounds, so we don't guess. These are practice questions based on what candidates report on public, community-kept lists, each written in our own words. RoundAlpha is not linked to TCS.

Coding questions
151
Easy / medium / hard
56 / 83 / 12
Top topic
Arrays & hashing
Page data updated
29 November 2026

( Questions )

15 TCS questions to practise.

Arrays & hashing

  1. 1

    Two SumEasy

    Given an array of integers nums and an integer target, return the positions of the two numbers that add up to target.

  2. 2

    Longest Leading MatchEasy

    Given an array of strings strs, return the longest sequence of leading characters that appears at the beginning of every string.

  3. 3

    First Substring MatchEasy

    Given the strings haystack and needle, return the zero-based index of the earliest position where needle occurs as a contiguous substring of haystack.

Dynamic programming, 1-D

  1. 4

    Longest Palindrome InsideMedium

    You are given a string s. Return the longest piece of it — a run of letters that sit next to each other in s — that reads the same forwards and backwards (a palindrome).

  2. 5

    Best Slice SumMedium

    You are given a list of whole numbers, nums, some of which may be negative. A slice is a run of one or more numbers that sit next to each other in the list.

Math & bits

  1. 6

    Check Digit SymmetryEasy

    Given an integer x, return true if its digits read identically from left to right and from right to left, and false otherwise.

  2. 7

    Rebuilding a Number BackwardMedium

    Implement reverse(x: int) -> int for a signed 32-bit integer x. Return the integer obtained by taking x's decimal digits from right to left, preserving its sign.

  3. 8

    The Single OneEasy

    Every number in nums appears exactly twice, except for one number that appears only once.

Sliding window

  1. 9

    Longest Unique StretchMedium

    Given a string s, return the length of the longest stretch of consecutive characters in which no character appears twice.

  2. 10

    Best Day to SellEasy

    prices[i] is the price of one share on day i. You may buy one share on one day and sell it on a later day.

Two pointers

  1. 11

    Biggest Water TankMedium

    A row of walls stands on flat ground, one metre apart; height[i] is the height of wall i.

  2. 12

    Three That Sum to ZeroMedium

    Given a list of integers nums, return every triple of values, taken from three different positions, that adds up to 0.

  3. 13

    Sort Three ColoursMedium

    The list nums holds only the values 0, 1 and 2 — think of them as red, white and blue. Rearrange nums in place so that every 0 comes first, then every 1, then every 2.

Stack

  1. 14

    Balanced BracketsEasy

    A string s is made only of the characters ( ) [ ] { }. Return true if every opening bracket is closed by a bracket of the same kind, and the brackets close in the right order.

Greedy

  1. 15

    Jump GameMedium

    You stand on the first square of a row of squares.

Want to write the code too? The TCS list on our coding practice page runs your answer against hidden tests, in six languages.

Questions

TCS interview: questions and answers

What coding questions does TCS ask?

Our bank holds 151 coding questions that candidates report from TCS interviews. The topics that come up most: arrays & hashing (41), math & bits (23), two pointers (12) and binary search (11). This page shows 15 of them, grouped by topic.

How hard are TCS coding questions?

Of the 151 coding questions, 56 are easy, 83 medium and 12 hard. The level you meet depends on the role and your experience, so practise easy and medium ones until you can explain them out loud, then add hard ones.

Are these the real TCS interview questions?

They are practice questions based on what candidates report from TCS interviews on public, community-kept lists. Each one is written in our own words. RoundAlpha is not linked to TCS, and no list can promise what a given interviewer will ask.

Can I practise a TCS interview for free?

Yes. A new account you sign up for yourself gets one short free practice interview. Name TCS as the company and the interviewer leans its questions toward that company. You can choose "No CV this time", so no CV is needed. You talk out loud and get a scored report at the end.

Read next

Ready when you are

Say it out loud once before it counts.

A short practice interview with TCS named as the company, then a scored report on every answer.

5 minutes, no CV needed. A practice round, not TCS's own.