2021 ((top)): Tcs Coding Questions

Write a program that takes three integers as input and prints the greatest among them. You must use the ternary operator only (no if-else or built-in max functions).

Input: a,b$c → Output: c,b$a

Based on papers from 2021, here are specific problems frequently encountered by candidates: Question Type Problem Description Basic Logic The Candies Problem : Given a fixed number of candies ( ) and a threshold ( ), take user input

Functions like malloc() , calloc() , and free() . Tcs Coding Questions 2021

Three trainees run a fitness test. The test lasts for 3 rounds. In each round, the oxygen levels of all 3 trainees are recorded. Calculate the average oxygen level for each trainee.

First line contains the text string. Second line contains the target keyword. Output: An integer representing the count of the keyword. Optimized Solution (Java)

1 ≤ N ≤ 10⁵ 1 ≤ M ≤ N 1 ≤ chocolates ≤ 10⁹ Write a program that takes three integers as

The 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

"A@b#c$D"

Strict adherence to output formats, including no leading/trailing spaces and specific precision for floating-point numbers. 2. Frequently Recurring Question Themes Three trainees run a fitness test

Palindromes, anagrams, regex-like tokenization, and character frequency counting.

Medium Marks: 15

Negative numbers or zero where positive integers are expected. Empty strings or single-character inputs.