TCS Digital Engineer Interview — Live Coding Under Questioning
- Field
- Engineering
- Company
- Tata Consultancy Services
- Role
- Digital Software Engineer Trainee
- Duration
- 20 min
- Difficulty
- Medium
- Completions
- New
- Updated
- 2026-06-09
What this round is about
- Topic focus. You write classic programs like reversing a string, checking a palindrome, or the Fibonacci series on a shared screen while the interviewer questions every choice.
- Conversation dynamic. The interviewer picks the problems live and cross-questions you mid-code: explain this line, state the complexity, handle empty input, do it without extra space.
- What gets tested. Staying correct and articulate under questioning, narrating your reasoning, and tracing your own code before you say it works.
- Round format. Around twenty minutes, voice plus a shared canvas, with deliberately easy problems so the pressure is the scrutiny, not the difficulty.
What strong answers look like
- Clarify before coding. You restate the problem in one line and write a sample input with its expected output, for example hello becomes olleh, before touching the logic.
- Narrate each line. You speak your reasoning as you write, so the interviewer can follow why each statement is there, not just what it does.
- Trace before declaring done. You run your code by hand on the sample you wrote and confirm the output, catching boundary bugs yourself.
- Justify the complexity. When asked, you give the correct time and space complexity and say why, for example O of N time because each character is touched once.
What weak answers look like (and how to avoid them)
- Coding in silence. Writing without speaking leaves the interviewer guessing how you think. Narrate every line, even when stuck.
- Skipping the sample. Jumping into a loop with no sample input means you have nothing to trace against. Write the input and expected output first.
- Declaring done without tracing. Saying it works before running it by hand hides off-by-one and boundary bugs. Always trace the sample before claiming correctness.
- Rewriting on a follow-up. Wiping the board when asked to optimise signals you do not understand your own code. Adjust the part that uses extra memory instead.
Pre-interview checklist (2 minutes before you start)
- Recall the two-pointer reverse. Be ready to reverse a string in place by swapping the two ends and moving inward, not by building a new string.
- Have a sample input habit ready. Plan to write a small input and its expected output for any program before you code.
- Think of the palindrome trace. Be ready to check a number or string by comparing ends, and to dry-run it on a value like 585.
- Identify your edge cases. Know what your program should return on empty input, a single character, or a negative number.
- Re-read your complexity basics. Be able to say O of N, O of one, and O of N squared and explain which loop causes which.
How the AI behaves
- Probes every line. It asks you to explain statements you wrote and to prove correctness by tracing, not by asserting it works.
- No mid-interview praise. It will not say great answer or tell you whether you passed. It acknowledges what you said and pushes further.
- Forgives syntax, not muddled logic. It does not penalise a forgotten semicolon or method name, but it pushes hard when your reasoning is unclear.
- Throws one curveball. After a clean solution it asks you to optimise it or handle an edge case, and watches whether you adapt or restart.
Common traps in this type of round
- The silent coder. Writing a whole function with no narration so the interviewer cannot follow the reasoning.
- The skipped dry run. Declaring the program done without tracing a sample, then being shown a boundary bug.
- The guessed complexity. Stating O of N because it sounds right, with no link to the loop that actually drives the cost.
- The full rewrite. Erasing a working solution and starting over when asked a small optimise-it follow-up.
- The frozen explanation. Going quiet when asked to explain a line you just wrote, instead of describing what it is meant to do.
- The unchecked edge case. Not saying what the program returns on empty or negative input until the interviewer forces it.
Sample problems you'll face
The 3 problems below are the same ones you'll work through in the live session — no surprises. Read the constraints carefully; the AI persona will refer you to the on-canvas card by problem number.
- 1Reverse a String
Write a function that reverses a string. Given an input string, return the same characters in the opposite order. Be ready to narrate each line, trace it on your sample, and state the time and space complexity. The interviewer may then ask you to do it without allocating any extra space.
Example inputhelloExample outputolleh- The interviewer wants the in-place approach: traverse till half the length and swap the characters from one end with the other.
- State the time complexity as O(N) and, for the in-place version, the auxiliary space as O(1).
- Handle the empty string and a single-character string without crashing.
- ON THE CANVAS: write your sample input and expected output first, then write the reversal function and trace each swap by hand before you say done.
- 2Check a Palindrome
Write a function that decides whether the input is a palindrome, meaning it reads the same forwards and backwards. Use the same comparing-the-two-ends idea from the reverse problem. Be ready to handle both a string and a number, and to dry-run it on the interviewer's value.
Example input585Example outputYes- For a string, use a two pointer approach comparing characters from one end with the other in O(1) extra space.
- For a number, reverse the digits using num % 10 to extract each digit and compare rev_num with num.
- Say what your check does with a negative number such as minus 121 before the interviewer forces it.
- ON THE CANVAS: trace 585 and 123 by hand through your comparison, showing each pair you check, before declaring the result.
- 3Print the Fibonacci Series
Write a program that prints the first N terms of the Fibonacci series, where each term is the sum of the two before it. Narrate the loop, trace the first few terms, and be ready to state the complexity and to discuss an iterative versus a recursive version.
Example input7Example output0, 1, 1, 2, 3, 5, 8- The iterative approach uses three variables a, b, c and runs in Time Complexity O(N) with Auxiliary Space O(1).
- Seed the first two terms as 0 and 1 and explain why the loop starts where it does.
- Say what the program prints for N equal to 0 or 1 before the interviewer asks.
- ON THE CANVAS: write out the first seven terms by hand from your three variables to confirm the loop produces 0, 1, 1, 2, 3, 5, 8.
Interview framework
You will be scored on these 6 dimensions. The full rubric with definitions is below.
What we evaluate
Your final scorecard breaks down across these dimensions. The full rubric and tier criteria are revealed inside the interview itself.
- Sample-First Problem Framing18%
- Think-Aloud Narration Quality18%
- Dry-Run Before Completion18%
- Complexity Reasoning Under Probe16%
- Curveball Recalibration Response16%
- Edge-Case Handling When Probed14%
Common questions
Sources this interview is built on
Real candidate-report URLs (Glassdoor / AmbitionBox / PrepInsta / GeeksforGeeks / Medium) reviewed when authoring the questions, persona, and rubric. Verify the realism yourself.
- TCS Coding Practice Question | Reverse a String | GeeksforGeeksgeeksforgeeks.org
- TCS Coding Practice Question | Check Palindrome Number - GeeksforGeeksgeeksforgeeks.org
- TCS Coding Practice Question | Fibonacci Series - GeeksforGeeksgeeksforgeeks.org
- TCS Digital Interview Questions - GeeksforGeeksgeeksforgeeks.org
- TCS Digital Interview Process - GeeksforGeeksgeeksforgeeks.org
- TCS Interview Experience 2026 | PrepInstaprepinsta.com