2021 - Tcs Coding Questions

print(nth_term(4)) # Output: 33

Here are coding problems reported by candidates who took the TCS NQT in 2021. Each includes a problem statement, logic, and Python/Java solution. Tcs Coding Questions 2021

In 2021, TCS recruitment relied heavily on automated coding assessments. The difficulty ranged from basic logic for the "Ninja" role to advanced algorithmic problems for the "Digital" role. print(nth_term(4)) # Output: 33 Here are coding problems

N=3 (odd) → 3! = 6. N=4 (even) → 1! + 2! + 3! + 4! = 1+2+6+24 = 33. and Python/Java solution. In 2021

Use a loop to extract digits using % 10 and build the reversed number by multiplying by 10 and adding the digit. Handle negative separately.

(Solutions available on request in the comments.)