Round 2 of the Tech Mahindra test carries two technical MCQ sections — Computer Programming (12 MCQs, 15 min) and Computer Science (12 MCQs, 15 min). Programming questions centre on output prediction, pseudocode tracing and error finding; CS questions cover OS, DBMS, networks and data structures.
Practice Tech Mahindra technical questions
These questions are from memory-based Tech Mahindra papers — including the classic static-variable and union output questions. Click an option to check your answer.
The function foo() below is called three times in a loop. What is the final output?
What is the output of the following code using a union?
A function computes the sum of absolute differences between adjacent elements, starting from a given 1-based index. For the array {1, 2, 3, 6, 4} and starting position 3, what is the output?
Topic checklist
- C/C++: static storage class, unions vs structures, pointers, memory leaks, scope rules.
- OOP/Java: four pillars, abstract class vs interface, overloading vs overriding.
- Data structures: stack vs queue, arrays vs linked lists, complexity of common sorts.
- OS: deadlock conditions, processes vs threads, paging basics.
- DBMS & networks: keys, normalization, SQL vs NoSQL, TCP vs UDP.
Your score here — together with Automata Fix — decides interview shortlisting and SuperCoder invitations.


