Usually features 2 coding questions with a total time of 45 minutes. 2. TCS Digital
Given a string of text and a target keyword, find the total number of times the keyword appears in the text. The search must be case-insensitive.
Element appearing more than n/2 times. Moore’s Voting Algorithm or HashMap.
Below are three highly representative coding questions that appeared across various campus slots in 2021, complete with clean Python and C++ implementations. Problem 1: The Sweet Seventeen (Number Base Conversion) Tcs Coding Questions 2021
TCS platforms often use standard input streams that require handling multiple lines of dynamic inputs. Practice using BufferedReader or Scanner in Java, cin optimization in C++, and sys.stdin.read in Python to prevent Time Limit Exceeded (TLE) errors. 2. Guard Against Edge Cases Ensure your code handles extreme inputs flawlessly:
matrix of 0s (empty) and 1s (full), find the row index with the maximum number of 1s. Mixed Series cap N raised to the t h power : Find the cap N raised to the t h power term of a series like (often a combination of two different geometric series). Trainee Oxygen Levels
Input: "listen" , "silent" → Yes. Sort and compare OR frequency count of 26 characters. Usually features 2 coding questions with a total
if (num == 0) count++;
| Section | Questions | Duration | |---|---|---| | Verbal Ability | 24 Questions | 30 minutes | | Reasoning Ability | 30 Questions | 50 minutes | | Numerical Ability | 26 Questions | 40 minutes |
Example:
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"
Allowed languages included C, C++, Java, Python, and Perl. Core Topics Tested in 2021
In 2021, TCS streamlined its recruitment process into two primary roles based on performance: and TCS Digital . The coding section was designed to filter candidates based on algorithmic thinking, mathematical logic, and code optimization. Key Highlights of the 2021 Pattern The search must be case-insensitive
Example: 45 → 45² = 2025 → split 20 + 25 = 45 → Yes. Square, convert to string, split, sum, compare.