Tcs Coding Questions 2021 High Quality
Master Input/Output: TCS uses a compiler that can be picky about trailing spaces or specific formatting. Practice reading from stdin and writing to stdout .
Source: Technoname TCS Digital Capability Assessment Solutions (28 Sept 2021)
The jar is refilled to full only when the number of remaining candies drops to or below a threshold Number of candies ordered. Number of candies sold and remaining. If the order exceeds INVALID INPUT Step-by-Step Logic: Initialize Constants and the refill threshold Validate Input : Check if the order is between Calculate Remaining : Subtract the order from Refill Check : If the new 2. Two-Wheeler vs. Four-Wheeler (TCS Ninja 2021)
return slow.data
String Handling: Palindromes, anagrams, and character shifting.
You are given an array of heights of students. Find the minimum number of jumps required to reach the end of the array, where you can jump from index i to i+1, i+2, or i+3 , but you cannot land on an index where the height is greater than the current height. This was the "killer" problem in TCS Digital December 2021.
Write a program to remove duplicate characters from a string without using an extra data structure (like set). Print the resulting string. Test case: "programming" → "progamin" Tcs Coding Questions 2021
Iterate through the range, convert each number to a string, and check if the count of unique characters equals the total character count. 4. Key Preparation Resources (Most Asked) TCS NQT Coding Questions and Answers 2021
Many candidates fail the TCS coding section despite writing accurate logic. The iON compiler enforces strict conditions:
The coding section is usually divided into two parts based on the targeted role (Ninja or Digital/Prime): Great Learning Foundation Coding: Master Input/Output: TCS uses a compiler that can
representing the number of candies ordered by a customer, determine the candies sold and the remaining candies in the jar. If the order cannot be fulfilled, print "INVALID INPUT". Input Format Line 1: Value of (Total Capacity) Line 2: Value of (Minimum Threshold) Line 3: Value of (Candies Ordered) Output Format Line 1: Candies Sold Line 2: Candies Left Solution Template (Python)
Problem Statement: Given a string, determine if it can be a palindrome by removing . Print "Yes" if possible, else "No". This is a variation of LeetCode 680 (Valid Palindrome II).