← Back to All Interview Preparation Guides
TCS National Qualifier & Technical Hiring

TCS Interview Questions 2026: Ninja, Digital & Prime

In-depth preparation breakdown for Tata Consultancy Services recruitment tracks. Covering NQT foundation aptitude, OOP and SQL core rounds, and Prime algorithmic coding questions.

TCS NINJA — Complete Preparation

Entry-level • CTC: ₹3.36 LPA • In-hand: ~₹26K/month

Written Test — NQT Foundation (75 min, 65 Questions)

  • Numerical Ability (20 Qs): Number system, LCM/HCF, percentages, profit/loss, time & work, ratio & proportion
  • Verbal Ability (25 Qs): Reading comprehension, sentence correction, fill in blanks, para jumbles
  • Reasoning (20 Qs): Coding-decoding, blood relations, series completion, puzzles, logic

Technical Interview Topics

  • OOP Concepts, DBMS (SQL, Normalization), Programming Basics (C/C++/Java/Python)
  • OS Concepts, Networking, Project explanation with STAR method

Interview Questions & Model Answers

Pro Tip: Focus on fundamentals. Practice 1-2 coding problems on paper. Be ready to explain your projects with the STAR method.

TCS Prime Track (₹9.0 – 11.5 LPA)

Advanced Algorithmic Coding Problems

TCS Prime candidates must solve advanced dynamic programming, sliding window, and two-pointer challenges during the advanced NQT section. Study the clean Python implementations below.

1

Longest Substring Without Repeating Characters (Sliding Window)

Given a string s, find the length of the longest substring without duplicate characters. Frequently tested in TCS Prime & Digital technical rounds.

def length_of_longest_substring(s: str) -> int:
    char_index_map = {}
    max_length = 0
    start = 0

    for end, char in enumerate(s):
        # If character was seen inside the current window, move start pointer
        if char in char_index_map and char_index_map[char] >= start:
            start = char_index_map[char] + 1
        
        char_index_map[char] = end
        max_length = max(max_length, end - start + 1)

    return max_length

# Test Verification:
# s = "abcabcbb" -> 3 ("abc")
# s = "bbbbb"    -> 1 ("b")
# s = "pwwkew"   -> 3 ("wke")
Time Complexity: O(N) single pass. Space Complexity: O(min(N, M)) where M is alphabet size.
2

Next Permutation (In-Place Array Reordering)

Rearrange numbers into the lexicographically next greater permutation. If no greater arrangement exists, rearrange into lowest possible order (sorted ascending).

def next_permutation(nums: list[int]) -> None:
    n = len(nums)
    # 1. Find the first decreasing element from the right
    i = n - 2
    while i >= 0 and nums[i] >= nums[i + 1]:
        i -= 1

    if i >= 0:
        # 2. Find the element just larger than nums[i] from the right
        j = n - 1
        while nums[j] <= nums[i]:
            j -= 1
        # Swap nums[i] and nums[j]
        nums[i], nums[j] = nums[j], nums[i]

    # 3. Reverse the subarray to the right of index i
    left, right = i + 1, n - 1
    while left < right:
        nums[left], nums[right] = nums[right], nums[left]
        left += 1
        right -= 1
Time Complexity: O(N). Space Complexity: O(1) in-place modification.
3

Coin Change Minimum Coins (Dynamic Programming)

Given an integer array of coin denominations and an integer amount, compute the fewest coins needed to make up that amount. Return -1 if impossible.

def coin_change(coins: list[int], amount: int) -> int:
    # dp[i] represents minimum coins needed for amount i
    dp = [float('inf')] * (amount + 1)
    dp[0] = 0

    for coin in coins:
        for x in range(coin, amount + 1):
            dp[x] = min(dp[x], dp[x - coin] + 1)

    return dp[amount] if dp[amount] != float('inf') else -1

# Test Verification:
# coins = [1, 2, 5], amount = 11 -> 3 (5 + 5 + 1)
# coins = [2], amount = 3         -> -1
Time Complexity: O(Amount * Coins). Space Complexity: O(Amount) tabular memory.
Abu - Founder of GetJobWithAbu

Abu

Founder of GetJobWithAbuCloud & Azure Developer (5+ Years IT Exp)

Cloud & Azure Developer with 5+ years of IT industry experience, having transitioned from a 4.8-year IT Support role into Software & Cloud Development. Dedicated to helping freshers, Tier-2/Tier-3 college graduates, and IT support engineers crack technical interviews through practical production insights, real-world scenario questions, and hands-on guidance.