TCS NQT Preparation Guide: Test Process, Sample Questions and Interview Answers
This guide is for engineering, MCA and science students in India preparing for the TCS National Qualifier Test (NQT) and the interviews that follow it. In recent drives the test had a Foundation part and an Advanced part, and the score decided whether a candidate was interviewed for a Ninja, Digital or Prime role, so check the official notification for your batch before you plan. The guide has 60 practice questions written by CoreHRx in three levels: the process, eligibility, registration and first HR questions; solved samples in the style of recent drives for every test area, plus fresher technical basics; and harder coding, pseudocode, managerial and offer questions. Try each one aloud or on paper before you read the answer.
- 60 questions, 3 levels
- Updated
- CoreHRx Jobs
Practice questions written by CoreHRx in the style of recent TCS drives. CoreHRx is not affiliated with or endorsed by TCS, and these are not actual exam questions.
How the TCS NQT worked in recent drives
- Foundation part: numerical ability, verbal ability and reasoning ability. In recent drives every candidate took this part.
- Advanced part: advanced quantitative and reasoning ability, plus advanced coding. In recent drives it was needed for a Digital or Prime interview.
- Roles: based on the test score, candidates in recent drives were shortlisted for Ninja, Digital or Prime interviews. Check the official notification for the roles open to your batch.
- Registration: candidates registered on the TCS NextStep portal under the IT category, filled in the application form and clicked Apply for Drive. Steps can change, so follow the official careers page.
- Interview: shortlisted candidates faced technical, managerial and HR questions, sometimes from one panel in a single sitting and sometimes in separate rounds.
How to prepare in four weeks
- Week 1: revise percentages, ratios, averages, the number system and time and work, and read one newspaper editorial a day for vocabulary and reading speed.
- Week 2: practise reasoning (series, coding-decoding, seating, blood relations, directions) and grammar-based verbal questions against a timer.
- Week 3: write code every day in one language: arrays, strings, loops, recursion and simple maths problems, reading input exactly as stated and printing only the required output.
- Week 4: take full mock tests, revise OOP, DBMS, SQL, OS and networking basics, and prepare a short, clear explanation of your final-year project.
On test and interview day
- Carry the documents listed in the official mail, such as the admit card and a government photo ID, and reach the test centre early.
- Do not get stuck: if a question is taking too long, mark it and move on. The TCS iON NQT page says its tests have no negative marking, but check the official notification for your drive.
- In coding, read input and print output in exactly the format asked; an extra prompt or space can fail the hidden test cases.
- In the interview, talk only about what is on your resume, and say so honestly when you do not know an answer.
- Watch your email and the NextStep portal, because results and interview invitations in recent drives came through those official channels.
TCS NQT interview questions: Easy questions
20 questions1. What is the TCS NQT and how is it used in hiring?
NQT stands for National Qualifier Test. TCS uses it as the entry-level test for freshers in its national hiring drives, and in recent drives the same test decided which interview a candidate was called for. TCS iON also offers an NQT as an open ability test that other companies can use, so you may see both names. For a TCS job, follow the TCS careers page and the NextStep portal, and check the official notification for the batches, courses and dates the drive covers.
2. What are the Foundation and Advanced parts of the TCS NQT?
In recent drives the TCS NQT was one integrated test in two parts. The Foundation part checks the basics every role needs: numbers, English and logical thinking. The Advanced part goes further, with harder quantitative and reasoning questions and a coding round, taken in the same sitting if you opt for it. Think of Foundation as the qualifier for the base role and Advanced as the route to the higher roles. The structure can change from one drive to the next, so check the official notification.
3. What does the Foundation part of the TCS NQT cover?
In recent drives the Foundation part had three areas. Numerical ability covers the number system, percentages, ratios, profit and loss, averages, time and work, basic statistics and data interpretation. Verbal ability covers grammar, vocabulary in context, sentence completion and reading comprehension. Reasoning ability covers series, coding-decoding, blood relations, seating, directions and visual or pattern reasoning. These are school-level ideas asked at speed, so timed practice matters more than new theory.
4. What does the Advanced part of the TCS NQT cover?
In recent drives the Advanced part had two areas. Advanced quantitative and reasoning ability asks multi-step aptitude problems, such as combined work, mixtures, probability, number puzzles and tougher arrangements. Advanced coding asks you to write working programs that read input and print exact output, judged against hidden test cases. Common languages such as C, C++, Java and Python have usually been allowed. Check the official notification for the languages and rules of your drive.
5. What are the Ninja, Digital and Prime roles at TCS?
They are the three fresher hiring tracks seen in recent drives. Ninja is the base track, for application development, testing and support work. Digital is a higher track for candidates who show stronger coding and problem-solving, often placed on newer technology projects. Prime is the top track, for the strongest performers in the Advanced part and the interview. The track you are interviewed for depends on your test performance. Names and roles can change, so check the official notification for your batch.
6. Is the Advanced part of the TCS NQT compulsory?
In recent drives the Advanced part was not needed for the Ninja track, but it was required if you wanted to be considered for a Digital or Prime role. If you skip it, you can only be considered for the base track. Most students should attempt it: even a partial coding score shows effort, and the Foundation score still counts on its own. Prepare for both parts, and confirm the rule for your drive in the official notification, because TCS can change it from one year to the next.
7. What are the basic eligibility rules for TCS NQT hiring?
In recent drives TCS asked for a full-time degree in eligible courses such as BE, BTech, ME, MTech, MCA or MSc, a minimum aggregate across Class 10, Class 12, diploma, graduation and postgraduation, no pending backlog when you appear, and a limit on total academic gaps. Freshers with a little work experience could also apply. TCS checks eligibility at every stage, and wrong details can cancel your candidature. The exact marks, years and age limits change, so check the official notification.
8. How do you register for a TCS NQT hiring drive?
In recent drives you registered on the TCS NextStep portal. A new user clicks Register Now, chooses the IT category, fills in basic details and gets a reference ID that starts with CT or DT. You then log in, complete the application form with your academic details and click Apply for Drive. Some drives also asked you to choose an in-centre test and a centre. Keep the reference ID safe, and follow the steps on the official careers page, because the process can change.
9. Why must you click Apply for Drive, and what if you picked the wrong category?
In recent drives, creating a NextStep profile was not enough: registration for the test was complete only after you clicked Apply for Drive, and candidates who missed this step got no test slot. The category matters too. For engineering and IT roles you register under IT, not BPS; the FAQ told anyone who chose wrongly to write to the support address it gave. Afterwards, use the Track Your Application page to confirm your status, and check the official notification for any change.
10. What happens after you take the TCS NQT?
In recent drives, candidates whose score qualified them got an email and a NextStep update inviting them to an interview for the Ninja, Digital or Prime track. The interview covered technical, managerial and HR questions, sometimes from one panel in a single sitting and sometimes in separate rounds. Document checks and the offer letter came after that. Read every mail carefully, because dates and venues come only through official channels. Check the official notification for the steps in your drive.
11. What is the difference between the TCS iON NQT and a TCS hiring drive?
TCS iON, the assessment arm of TCS, offers the NQT as an ability test that students and freshers can take and share with many companies. TCS iON says it reports a score rather than a pass or fail, and that it does not itself arrange job interviews. A TCS hiring drive is TCS recruiting for its own roles through NextStep and the careers page. In recent drives the two used a similar test structure. Read the official notification to see which test a drive accepts.
12. Which documents should you keep ready for the TCS NQT and the interview?
Keep your Aadhaar card ready, because in recent drives TCS asked for it when creating the NextStep reference ID, and your name and date of birth had to match it. Also keep Class 10 and 12 marksheets, all semester marksheets, your degree or provisional certificate if you have one, a photo ID, passport-size photos and an updated resume. For an in-centre test, carry the admit card. The marks you enter in the form must match your marksheets. Check the official notification for the full list.
13. Tell me about yourself.
Keep it to about a minute and follow present, past, future. Start with who you are now: a final-year BTech student in computer science from your college in, say, Pune. Then the past: one project and one achievement, such as a library app you built in Java with MySQL and a hackathon you took part in. End with the future: you want to start your career in software development where you can learn on large client projects. Do not repeat your resume line by line or talk at length about family details.
14. Why do you want to join TCS?
Give reasons that are true for you, not a list copied from the website. Good points: TCS works for clients across many industries, so a fresher sees real projects at scale; it has structured training for new joiners; and people can move across technologies over time. Then link it to yourself, for example that you enjoy working with databases and want exposure to large enterprise systems. Avoid saying it is a safe job or that your friends work there. Keep the answer short and sincere.
15. Are you willing to relocate?
In recent drives TCS has placed freshers in offices across India, and the location depends on project needs, so the expected answer is yes. Say you are open to any location and see it as a chance to learn and become independent. If you have a genuine constraint, such as a parent who needs care, mention it politely, but do not set conditions on day one. Never say yes in the interview if you plan to refuse a posting later; that damages trust and your record with the company.
16. Are you comfortable working in shifts?
Many IT service projects support clients in other time zones, so some teams work early, late or rotational shifts. Answer honestly that you understand this and are willing to work in shifts when the project needs it. You can add that you manage your health and routine well, for example from experience with exam-season night study or a part-time job. If shift work is a real problem for you, think about it before joining, but in the interview show flexibility and a positive attitude.
17. What are your strengths and weaknesses?
Pick one or two strengths and prove each with an example: you are consistent, shown by practising coding every day for months, or you learn quickly, shown by picking up React for a project. For a weakness, choose a real but non-critical one and show what you are doing about it, such as nervousness in public speaking and joining the college debate club to improve. Avoid fake weaknesses like I work too hard, and avoid ones central to the job, such as disliking coding.
18. Where do you see yourself in five years?
Show ambition that fits the company. A good answer: in five years you want to be a strong developer in one area, such as cloud or data engineering, trusted to handle client modules on your own and to guide new joiners. Add that you plan to keep learning through certifications and project work. Avoid saying you plan an MBA abroad or your own startup soon, because it suggests you will leave early. Keep it realistic and tied to growth inside the organisation.
19. Why should we hire you?
Connect three things: your skills, your attitude and the role. For example: you have a good grip on Java, SQL and data structures, shown by your project and regular coding practice; you are a quick learner who is comfortable with new tools; and you are flexible about technology, location and shifts. End with a line about wanting to contribute from your first project. Do not compare yourself with other candidates or claim you are the best; let your examples do the work.
20. Do you have any questions for us?
Always ask one or two thoughtful questions, because saying no can sound uninterested. Good ones: What does the training for new joiners usually cover? Which technologies do freshers in this track typically work on? What would you expect from me in the first few months? Avoid questions about leave, hikes or work from home at this stage, and do not ask anything already answered in the official notification. Listen to the answer properly and thank the panel at the end.
Ready to check yourself? Take the free TCS NQT mock test
TCS NQT interview questions: Medium questions
20 questions21. Numerical sample: a shopkeeper marks an item 40% above cost and then gives a 15% discount. What is the profit percent?
Take the cost price as 100. The marked price is 140. A 15% discount on 140 is 21, so the selling price is 119 and the profit is 19, which is 19% of the cost. Shortcut: for a markup of m% and a discount of d%, profit % = m - d - (m x d)/100 = 40 - 15 - 6 = 19. Always take the discount on the marked price and the profit on the cost price. This is in the style of the numerical questions in recent drives, where markup and discount often come together.
22. Numerical sample: A can finish a job in 12 days and B in 18 days. They work together for 4 days, then A leaves. How many more days does B need?
Use the LCM of 12 and 18, which is 36, as the total work. A does 3 units a day and B does 2, so together they do 5 units a day. In 4 days they finish 20 units, leaving 16. B alone needs 16/2 = 8 more days. The LCM method avoids fractions and is quicker against the clock. Check: A worked 4 days for 12 units and B worked 12 days for 24 units, which adds up to 36. Always verify with a quick total like this.
23. Numerical sample: what is the remainder when 2^100 is divided by 7?
Look for a repeating pattern. Powers of 2 divided by 7 leave remainders 2, 4, 1 and then repeat, because 2^3 = 8 leaves remainder 1. So write 2^100 as (2^3)^33 x 2. The first part leaves remainder 1, so the answer is the remainder of 2 divided by 7, which is 2. Finding a power that leaves remainder 1 is the fastest method for large exponents. This pattern method also works for unit-digit questions, where the cycle is taken modulo 10.
24. Verbal sample: find the error in "Each of the students have submitted their assignment on time."
"Each of" takes a singular verb, so "have submitted" should be "has submitted". The subject is "each", not "students"; the phrase "of the students" only describes it. Formal usage also prefers "his or her assignment", although singular "their" is widely accepted today, so most tests mark only the verb. The same rule applies to "every one of", "either of" and "neither of". Read past the prepositional phrase to find the real subject before you check the verb.
25. Verbal sample: choose the word that fits. "The manager was ____ about the deadline; she would not extend it by even a day." (a) flexible (b) adamant (c) indifferent (d) uncertain
The second half of the sentence explains the first: she would not extend the deadline at all. So the blank needs a word meaning firm and unwilling to change, and adamant fits. Flexible says the opposite, indifferent means not caring, which does not match a firm refusal, and uncertain contradicts it. In sentence completion, find the clue word or phrase, decide whether the blank agrees or contrasts with it, and only then look at the options.
26. Verbal sample: arrange into a paragraph. P: As a result, many small shops now accept digital payments. Q: UPI made it possible to send money instantly from a phone. R: Before that, paying a vendor usually meant cash. S: Even street vendors display QR codes today.
Start with the sentence that needs nothing before it. Q introduces UPI, so it opens. R says "Before that", which refers back to UPI, so it follows Q. P begins "As a result", which needs a cause, the arrival of UPI, so it comes after the contrast in R. S begins "Even", which extends P to the smallest sellers, so it closes. The order is QRPS. Link words such as before that, as a result, however and even are the quickest clues in para jumbles.
27. Reasoning sample: if COMPUTER is written as DPNQVUFS, how is SYSTEM written in that code?
Compare letter by letter: C becomes D, O becomes P and M becomes N, so each letter moves one step forward in the alphabet. Apply the same rule to SYSTEM: S to T, Y to Z, S to T, T to U, E to F and M to N, giving TZTUFN. In coding questions, check a simple shift first, then reversal, then alternating patterns such as +1, -1. Writing the alphabet with positions (A = 1 to Z = 26) on your rough sheet saves time on every such question.
28. Reasoning sample: A, B, C, D and E sit in a row facing north. C is in the middle and A is to the immediate left of C. D is not at either end, and E is somewhere to the right of D. Who sits at the right end?
Number the seats 1 to 5 from left to right; facing north, your left is the west side. C is in seat 3, and A, immediately to its left, is in seat 2. That leaves seats 1, 4 and 5 for B, D and E. D is not at an end, so D takes seat 4. E is to the right of D, so E is in seat 5, and B takes seat 1. The order is B, A, C, D, E, so E sits at the right end. Fix the certain positions first, then place the people with the most restrictions.
29. Reasoning sample: find the next term in the series 3, 7, 15, 31, 63, ?
Each term is double the previous one plus 1: 3 x 2 + 1 = 7, 7 x 2 + 1 = 15, and so on, so the next term is 63 x 2 + 1 = 127. Another view: every term is one less than a power of 2 (4 - 1, 8 - 1, 16 - 1). The differences 4, 8, 16 and 32 double each time, which confirms the pattern. In series questions, check differences first, then ratios, then squares and cubes, then mixed rules such as multiply and add.
30. Advanced quant sample: in how many ways can the letters of LEADER be arranged so that the vowels always come together?
LEADER has six letters: consonants L, D and R and vowels E, A and E. Treat the three vowels as one block. That gives four units (L, D, R and the block), arranged in 4! = 24 ways. Inside the block, E, A and E can be arranged in 3!/2! = 3 ways, because the two Es are identical. Total = 24 x 3 = 72. In arrangement questions, glue together the items that must stay together, arrange the units, then multiply by the arrangements inside the block.
31. Advanced reasoning sample: a number leaves remainder 3 when divided by 5 and remainder 4 when divided by 6. What is the smallest such number?
Look at the gap between each divisor and its remainder: 5 - 3 = 2 and 6 - 4 = 2. Both gaps are equal, so the number is 2 less than a common multiple of 5 and 6. The LCM is 30, so the smallest number is 30 - 2 = 28. Check: 28 divided by 5 leaves 3, and 28 divided by 6 leaves 4. The general answer is 30k - 2. When the gaps differ, list the larger divisor plus its remainder (10, 16, 22, 28) and test each against the other condition.
32. Coding sample: read an integer N and print the sum of its digits. What must a correct solution handle?
Repeatedly take the last digit with N mod 10, add it to a running sum and remove it with integer division by 10, until N becomes 0. A strong solution also handles the edge cases that hidden test cases often check: N = 0 should print 0, a negative N should use its absolute value, and very large inputs may need a long type or reading the number as a string. Print only the sum, with no extra text such as Enter a number, because the output is compared exactly.
n = abs(int(input()))
total = 0
while n > 0:
total += n % 10
n //= 10
print(total)33. Coding sample: check whether a string is a palindrome, ignoring case, spaces and punctuation.
Use two pointers, one at each end. Skip characters that are not letters or digits, compare the two characters in lower case, and move both pointers inward. If any pair differs, it is not a palindrome; if the pointers meet or cross, it is. This runs in linear time and needs no extra string. For example, Nurses Run becomes nursesrun, which reads the same both ways. Reversing a cleaned copy also works, but interviewers like to hear the two-pointer method explained.
int isPalindrome(char s[]) {
int i = 0, j = strlen(s) - 1;
while (i < j) {
if (!isalnum(s[i])) { i++; continue; }
if (!isalnum(s[j])) { j--; continue; }
if (tolower(s[i]) != tolower(s[j])) return 0;
i++; j--;
}
return 1;
}34. Explain the four pillars of OOP with simple examples.
Encapsulation keeps data and the methods that use it together and hides internal details, such as a BankAccount class with a private balance changed only through deposit and withdraw. Abstraction shows only what a user needs, like an ATM screen that hides the banking system behind it. Inheritance lets SavingsAccount reuse and extend Account. Polymorphism lets one call behave differently by object type, such as calculateInterest for savings and current accounts.
35. What is normalisation in DBMS, and what are 1NF, 2NF and 3NF?
Normalisation organises tables to remove repeated data and update problems. 1NF: every column holds a single value, so no list of phone numbers in one cell. 2NF: in 1NF, and every non-key column depends on the whole primary key, not just part of a composite key. 3NF: in 2NF, and no non-key column depends on another non-key column, for example keeping the city in a table keyed by PIN code instead of beside every student. Reporting systems sometimes denormalise for speed.
36. Write an SQL query to find the second highest salary in an Employee table.
One standard answer uses a subquery: select the maximum salary that is less than the overall maximum. Another uses DISTINCT with ORDER BY, skipping the first row with LIMIT and OFFSET in MySQL. A third uses DENSE_RANK as a window function, which extends easily to the Nth highest and handles ties correctly. Say what happens when there is no second value: the subquery version returns NULL, which is usually what is wanted. Explain your choice instead of only writing one query.
-- subquery
SELECT MAX(salary) FROM Employee
WHERE salary < (SELECT MAX(salary) FROM Employee);
-- window function (also works for the Nth highest)
SELECT DISTINCT salary FROM (
SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) AS rnk
FROM Employee
) t
WHERE rnk = 2;37. In operating systems, what is the difference between a process and a thread, and what is a deadlock?
A process is a program in execution with its own memory space; a thread is a lighter unit of execution inside a process that shares its memory with the other threads. Switching between threads is cheaper, but shared memory needs synchronisation. A deadlock happens when processes each hold a resource and wait for one held by another, so none can proceed. It needs four conditions together: mutual exclusion, hold and wait, no preemption and circular wait. Breaking any one prevents it.
38. What happens when you type a website address into a browser and press Enter?
The browser first finds the IP address through DNS, checking its own cache, then the operating system and then DNS servers. It opens a TCP connection to the server with a three-way handshake, and for HTTPS it performs a TLS handshake to set up encryption. It sends an HTTP request, the server returns a response with HTML, and the browser fetches CSS, scripts and images and renders the page. Naming the layers involved, such as application, transport and network, earns extra credit.
39. In Java, what is the difference between == and equals(), and between String and StringBuilder?
For objects, == checks whether two references point to the same object, while equals() checks whether the contents are equal, as the class defines it. Two String objects with the same text can fail == but pass equals(), so always compare strings with equals(). String is immutable: every change creates a new object. StringBuilder is mutable and much faster when you build a string in a loop. StringBuffer is like StringBuilder but synchronised, so it is slower and used only when threads share it.
40. How should you explain your final-year project in a TCS interview?
Prepare a short version with a clear structure: the problem, why it matters, your solution, the technology stack and why you chose it, your own part in the team, one difficulty you solved and the result. For example, an attendance system using face recognition in Python with MySQL, where you designed the database and fixed slow queries with indexes. Expect follow-up questions on every tool you name, so mention only what you can explain, and be ready to sketch the design on paper.
Ready to check yourself? Take the free TCS NQT mock test
TCS NQT interview questions: Hard questions
20 questions41. Pseudocode: what does this program print?
Trace it in a table with columns for i, a, b and c. At i = 1 (odd) c becomes 0 - 3 = -3, then a = 6 and b = 6. At i = 2 (even) c = -3 + 6 = 3, then a = 7 and b = 12. At i = 3 (odd) c = 3 - 12 = -9, then a = 8 and b = 24. At i = 4 (even) c = -9 + 8 = -1, then a = 9 and b = 48. The output is -1. Note that a and b change after c in each pass, so the order of updates matters. Questions in this style reward careful tracing over guessing.
Integer a = 5, b = 3, c = 0
for (i = 1 to 4)
if (i mod 2 == 0)
c = c + a
else
c = c - b
end if
a = a + 1
b = b * 2
end for
print c42. Pseudocode: what is printed after these XOR, AND and OR operations? (^ is XOR, & is AND, | is OR)
The three XOR lines are the classic swap without a temporary variable, because a ^ a = 0 and a ^ 0 = a. After them x = 10 and y = 12. In binary 10 is 1010 and 12 is 1100. AND keeps the bits set in both, giving 1000, which is 8. OR keeps the bits set in either, giving 1110, which is 14. So the output is 10 12 8 14. Mention that the XOR swap fails when both names refer to the same memory location, because the value becomes 0.
Integer x = 12, y = 10
x = x ^ y
y = x ^ y
x = x ^ y
print x, y, (x & y), (x | y)43. Pseudocode: what does f(5) return for this recursive function?
Build the values from the bottom instead of expanding the whole call tree. The base case gives f(0) = 1 and f(1) = 1. Then f(2) = f(1) + 2 x f(0) = 3, f(3) = f(2) + 2 x f(1) = 5, f(4) = 5 + 2 x 3 = 11 and f(5) = 11 + 2 x 5 = 21, so it returns 21. Plain recursion repeats work and grows exponentially; storing results in an array, by memoisation or a bottom-up loop, makes it linear. Saying that lifts an answer from correct to strong.
function f(n)
if (n <= 1)
return 1
end if
return f(n - 1) + f(n - 2) * 2
end function
print f(5)44. Coding: find the second largest element in an array in a single pass.
Sorting works but costs n log n time. A single pass is better: keep two variables, first and second, both starting below any possible value. For each element, if it is bigger than first, move first into second and update first; else if it is bigger than second and smaller than first, update second. At the end, if second was never updated, all elements were equal and there is no second largest, so return -1 or whatever the problem asks. This runs in linear time with constant extra space.
def second_largest(arr):
first = second = float('-inf')
for x in arr:
if x > first:
second, first = first, x
elif first > x > second:
second = x
return second if second != float('-inf') else -145. Coding: check whether two lowercase strings are anagrams in linear time.
Two strings are anagrams if they contain the same characters the same number of times. Sorting both and comparing takes n log n time. A faster way uses a count array, one slot per letter: add 1 for each character of the first string, subtract 1 for each character of the second, and check that every count ends at zero. If the lengths differ, return false at once. For Unicode or mixed input, use a hash map instead. Ask whether spaces and case should be ignored before you start coding.
int isAnagram(char *a, char *b) {
int count[26] = {0}, i;
if (strlen(a) != strlen(b)) return 0;
for (i = 0; a[i]; i++) {
count[a[i] - 'a']++;
count[b[i] - 'a']--;
}
for (i = 0; i < 26; i++)
if (count[i] != 0) return 0;
return 1;
}46. Coding: rotate an array to the right by k positions in place.
First take k mod n, so that large k values work. Then use the reversal method: reverse the whole array, reverse the first k elements and reverse the remaining n - k elements. For 1 2 3 4 5 with k = 2, reversing all gives 5 4 3 2 1, reversing the first two gives 4 5 3 2 1, and reversing the rest gives 4 5 1 2 3. It runs in linear time with constant extra space. Shifting one step k times also works but takes n x k time, which can fail large hidden test cases.
static void reverse(int[] a, int i, int j) {
while (i < j) { int t = a[i]; a[i++] = a[j]; a[j--] = t; }
}
static void rotateRight(int[] a, int k) {
int n = a.length;
if (n == 0) return;
k = k % n;
reverse(a, 0, n - 1);
reverse(a, 0, k - 1);
reverse(a, k, n - 1);
}47. Coding: find the maximum sum of a contiguous subarray.
Kadane's algorithm keeps two values while scanning: the best sum of a subarray ending at the current element, and the best sum seen so far. At each element, the current sum is either the element alone or the element added to the previous current sum, whichever is larger; then update the overall best. For -2 1 -3 4 -1 2 1 -5 4 the answer is 6, from 4 -1 2 1. Start both values from the first element, not zero, so an all-negative array returns its largest element.
def max_subarray(a):
cur = best = a[0]
for x in a[1:]:
cur = max(x, cur + x)
best = max(best, cur)
return best48. Coding: find the length of the longest substring without repeating characters.
Use a sliding window with a map from each character to its last index. Move the right end one step at a time. If the current character was seen inside the window, move the left end to one past its last index. Then update the character's index and the best length. For abcabcbb the answer is 3 (abc), and for pwwkew it is 3 (wke). Each character enters and leaves the window at most once, so it runs in linear time, unlike checking every substring, which is far slower.
def longest_unique(s):
last, left, best = {}, 0, 0
for right, ch in enumerate(s):
if ch in last and last[ch] >= left:
left = last[ch] + 1
last[ch] = right
best = max(best, right - left + 1)
return best49. A teammate is not doing his share and the deadline is close. What do you do?
First talk to him privately and find out why: he may be stuck, unclear about the task or dealing with something personal. Offer help, such as pairing on the hard part or splitting the work more clearly, and agree on short daily check-ins. If the work still does not move and the deadline is at risk, tell the team lead early, with facts rather than complaints, and propose a plan. The panel is checking that you protect delivery while staying fair to people, so avoid blaming or silently doing all his work.
50. The client asks for a change one day before release. How do you handle it?
Do not say yes or no on the spot. Understand the change and why it is needed, then assess the impact with your team: the effort, the risk to an already tested build and what else would slip. Share the options with your lead, for example releasing on time and adding the change in the next build, or moving the release so the change is fully tested. The decision on scope usually belongs to the project manager and the client together. Show that you respect the client and also protect quality.
51. You find a serious bug in your own code after it has reached the client. What do you do?
Own it immediately. Tell your lead what the bug is, which users or data it affects and how you found it, instead of fixing it quietly and hoping nobody notices. Propose a quick fix or workaround, test it properly and follow the project's change process to release it. Afterwards, find the root cause and add a test or review step so it cannot happen again. Interviewers value honesty and ownership far more than a perfect record, because hidden mistakes cost clients much more.
52. You disagree with your manager's technical approach. How do you handle it?
Raise it privately and with evidence. Explain your concern and your alternative with data, such as a small proof of concept or a comparison of performance and effort, and ask about constraints you may not know, such as client standards or deadlines. If the manager still prefers the original approach after hearing you, commit to it fully and do your best work on it. Disagreeing respectfully and then supporting the team decision is the answer the panel wants; arguing in front of the client is not.
53. You are assigned to a technology or domain you did not want, such as support or a legacy system. How do you respond?
Show that you treat every project as learning. Say you would accept the assignment, learn the technology properly and deliver well, because a fresher gains a lot from seeing how large client systems really run, including older ones. Add that you would build your preferred skills in parallel through internal learning, certifications and side projects, and share your interest with your manager at the right time, such as during reviews. Refusing or showing frustration in a first role is the weakest answer.
54. Two leads give you urgent tasks at the same time. How do you prioritise?
Do not guess and do not quietly drop one. Note what each task needs and when it is due, then tell both leads about the clash and ask them, or the project manager, to agree on priority, ideally based on client impact. While that is being settled, start the task with the nearer deadline or the bigger business impact, and keep both leads updated. This shows you can plan your own work, communicate early and escalate correctly, which is exactly what a managerial question like this tests.
55. What are your salary expectations?
For freshers in recent drives, the pay for each track was fixed by the company and shared in the official notification and offer letter, so there is nothing to negotiate in the interview. A good answer: you know the company has a standard structure for freshers in this role, you are comfortable with it, and your focus now is learning and performance. Do not quote a number of your own or compare with other companies. If you have not seen the details, say you will go by the official offer terms.
56. You are offered the Ninja role but hoped for Digital. What would you say?
Thank the panel and show that you are positive about joining: the base role still gives you client projects, training and a strong start. Avoid sounding disappointed or asking to be moved up in the interview. If the official notification or your offer letter mentions a later route to a higher track, you can ask about it politely, but do not assume one exists. Then focus on doing well in training and your first project, because that is what drives your growth over the following years.
57. You already have another offer. Will you join TCS?
Be honest without playing companies against each other. If you have another offer, say so briefly and explain what attracts you to this role, such as the training, project variety and the kind of work you want to do. If you are sure you will join, say so clearly. If you are still deciding, do not promise; say you are keen and will confirm within the time the offer process allows. Accepting several offers and dropping them later hurts your reputation and is unfair to other candidates.
58. How do you explain a gap year in your education?
State the reason briefly and truthfully, then show what you did with the time. For example: you took a year to prepare for an entrance exam, did not get the result you wanted, and used part of the year to learn Python and build a small project. Do not over-explain or sound guilty. Make sure the gap is within the limit in the official notification, because TCS checks eligibility at every stage. The interviewer mainly wants to know that you stayed productive and are now fully committed.
59. You had a backlog or low marks in one semester. How do you handle the question?
Accept it without excuses, explain the cause in one line and show the recovery. For example: in the third semester you struggled with Engineering Mathematics while adjusting to hostel life, cleared the paper in the next attempt and improved your scores in later semesters. Point to proof of improvement, such as better grades, certifications or a strong project. In recent drives no pending backlog was allowed at the time of selection, so clear it before you apply and check the official notification.
60. You are from a non-computer branch such as mechanical or ECE. Why should we hire you for an IT role?
Show that the move is deliberate, not a fallback. Explain what drew you to software, for example automating a lab report in Python, and prove the effort: regular coding practice, an online course, a project or a hackathon. Then link your branch to the work: engineering builds logic and comfort with maths, and knowing manufacturing or electronics can help on client projects in those industries. Expect basic programming, OOP and DBMS questions that test your claim, and answer them calmly.
Practice questions for November 2026
New every month3 questions from the TCS NQT mock test, the way they appear in it. A new set comes on the 1st of every month. Pick your answer, then open it.
-
What will be the output of the following pseudocode?
Integer n = 83030, rev = 0 while (n > 0) rev = rev * 10 + n mod 10 n = n / 10 // integer division end while Print rev- 3037
- 3048
- 3034
- 3038
Show the answer
Answer: 3038. Each step moves the last digit of n to the end of rev, so rev becomes 83030 reversed: 3038.
-
Arrange the sentences in the most logical order. P: But the projector would not connect to the laptop. Q: The meeting was supposed to start at ten. R: The team spent twenty minutes fixing it. S: Since then, they test all equipment a day in advance.
- PQRS
- QSPR
- QPSR
- QPRS
Show the answer
Answer: QPRS. The right order is QPRS. Plan, the problem signalled by 'But', the fix, and the lesson learned ('Since then').
-
A cube of side 18 cm is painted on all faces and cut into small cubes of side 3 cm. How many small cubes have at least one face painted but not more than two?
- 96
- 48
- 152
- 144
Show the answer
Answer: 144. There are 6 cubes along each edge. One face painted: 96; two faces: 48. Together: 144.
Ready to apply?
Browse the open jobs on CoreHRx. Create a free profile once and apply with it.