Tcs Coding Questions — 2021

num = int(input()) b, c = decimal_to_binary(num) print(b) print(c)

public class Main public static void main(String[] args) Scanner sc = new Scanner(System.in); String num = sc.next(); int len = num.length(); int[] freq = new int[10];

Based on 2021 slot analyses, questions were primarily drawn from these core areas: Tcs Coding Questions 2021

In 2021, the TCS National Qualifier Test (NQT) and Digital Capability Assessment (DCA) featured a shift toward mixed-series logic and practical scenario-based problems. While the "Ninja" role prioritized basic mathematical logic, "Digital" roles required handling complex data structures like matrices and linked lists.

import java.util.*; public class Main public static void main(String[] args) Scanner s = new Scanner(System.in); int number = s.nextInt(); int one = 0,two = 0; int five = (number-4)/5; if(((number-5*five) % 2) == 0) one = 2; else one = 1; num = int(input()) b, c = decimal_to_binary(num) print(b)

Example:

Convert rows into columns by swapping matrix[i][j] with matrix[j][i] . To prepare effectively for the TCS NQT coding

To prepare effectively for the TCS NQT coding section, focus on mastering basic input/output operations, handling string-to-number conversions smoothly, and understanding the core variations of classic mathematical and array algorithms.

Problem 3: Keyword Search & Extraction (String Manipulation)

Scroll to Top