Tcs Coding Questions 2021 Tcs Coding Questions 2021 Tcs Coding Questions 2021
Tcs Coding Questions 2021

All your games, in one place

Pegasus is a graphical frontend for browsing your game library (especially retro games) and launching them from one place. It's focusing on customizability, cross platform support (including embedded devices) and high performance.

A modern retro-gaming setup

Instead of launching different games with different emulators one by one manually, you can add them to Pegasus and launch the games from a friendly graphical screen from your couch. You can add all kinds of artworks, metadata or video previews for each game to make it look even better!

Full control over the UI

With additional themes, you can completely change everything that is on the screen. Add or remove UI elements, menu screens, whatever. Want to make it look like Kodi? Steam? Any other launcher? No problem. You can add animations and effects, 3D scenes, or even run your custom shader code.

Open source, cross platform, compatible with others

Pegasus can run on Linux, Windows, Mac, Raspberry Pi, Odroid and Android devices. It's compatible with EmulationStation metadata and gamelist files, and instantly recognizes your Steam games!

Tcs Coding Questions 2021

Tcs Coding Questions 2021 | 480p |

The 2021 TCS NQT coding questions were characterized by a mix of fundamental logical problems and scenario-based challenges designed to test basic programming proficiency and problem-solving logic. The exam typically featured two coding questions: one of "Easy" to "Moderate" difficulty and another that was more advanced. 1. Key Patterns and Question Types

The 2021 questions largely focused on manipulating basic data structures and applying mathematical logic.

Mathematical & Logical Scenarios: Many questions were framed as real-world problems.

The JAR Problem: Implement a system for a candy jar with a maximum capacity . Given an order for

candies, update the jar or return "INVALID INPUT" if the request exceeds current stock. If stock falls below a threshold , refill it.

Vehicle Manufacturing: Calculate the number of two-wheelers ( TWcap T cap W ) and four-wheelers ( FWcap F cap W ) given the total number of vehicles ( ) and total wheels ( Tcs Coding Questions 2021

Array Manipulation: Common tasks included finding the second largest/smallest elements, reversing arrays, or rotating elements by positions using algorithms like Block Swap.

String Challenges: Frequent topics included checking for palindromes, counting vowels/consonants, and determining if two strings were anagrams using frequency counters (Hash Maps) for optimization.

Number Theory: Questions often required identifying Prime numbers, Armstrong numbers, Strong numbers, or calculating GCD/LCM. 2. Common 2021 Series Questions TCS NQT Coding Sheet - TCS Coding Questions - Tutorial


3. Top 5 Most Asked "TCS 2021" Coding Problems

Below are curated problems based on the actual difficulty level and logic asked in 2021.

Why Data from 2021 Still Matters

You might ask: "Why study 2021 questions if the exam is in 2025/2026?" Here is the truth about TCS: The 2021 TCS NQT coding questions were characterized

  1. Question Recycling: TCS has a massive question bank. Approximately 40% of coding problems from 2021 resurface in later years with swapped variable names.
  2. Pattern Consistency: The core topics—Arrays (60%), Strings (30%), and Basic Mathematics (10%) —have remained unchanged since 2021.
  3. Difficulty Ceiling: In 2021, TCS introduced the "one logic twist" (e.g., removing one character from palindrome). That twist remains the standard.

Tips to Crack TCS Coding Round (2021 Style)

  1. Master basics – Loops, if-else, arrays, strings.
  2. Practice edge cases – Empty input, single element, negative numbers.
  3. Write clean code – Use meaningful variable names and comments.
  4. Test manually – Dry-run before final submission.
  5. Time management – Spend 5 min understanding problem, 10 min coding, 5 min testing.
  6. Don’t overcomplicate – Brute force is accepted if constraints are small.

Question 4: Count pairs with given sum

Problem:
Given an array and a target sum, count pairs (i,j) where i<j and arr[i]+arr[j] = sum.

Example:
Array: [1, 5, 7, -1, 5], sum=6 → Output: 3 pairs → (1,5), (1,5), (7,-1)

Solution (Python):

def count_pairs(arr, target):
    count = 0
    for i in range(len(arr)):
        for j in range(i+1, len(arr)):
            if arr[i] + arr[j] == target:
                count += 1
    return count

arr = list(map(int, input().split())) target = int(input()) print(count_pairs(arr, target))


6. The "Prime Number in a Range" with Digit Sum Condition

Asked in: TCS NQT Foundation (December 2021 – Last slot)

Problem Statement:
Find all numbers between two given integers L and R (inclusive) such that:

  1. The number itself is prime.
  2. The sum of its digits is also a prime number.

Example:

Logic: Write an isPrime() function and a digitSum() function.