Questions 2021 - Tcs Coding
For millions of engineering graduates in India, Tata Consultancy Services (TCS) represents more than just a job—it is a career launchpad. As the largest private-sector employer in the country, TCS conducts its National Qualifier Test (NQT) yearly. While the exam pattern evolves, the coding section remains the highest-scoring and most decisive part.
Input: "WWWNWWWNW" Output: "FNWFNW" (first three W→F, then single N, then next three W→F, then N, then single W). Tcs Coding Questions 2021
import java.util.Scanner; 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]; For millions of engineering graduates in India, Tata
Input: [11, 23, 41, 29, 56] Output: 3 (Because 11→1+1=2(prime), 23→2+3=5(prime), 41→4+1=5(prime), 29 is prime but 2+9=11(prime) actually also qualifies—so 4? Wait: 56 is not prime. So output is 4). Input: "WWWNWWWNW" Output: "FNWFNW" (first three W→F, then
Introduction: The Gatekeeper of an IT Dream