If you have work experience, the process may slightly differ (or have extra emphasis on your project history, job-related skills, domain expertise) — but generally follows the pattern: written/technical test → technical interview → HR interview.
In the technical assessment + interview, expect questions covering:
In interviews, you may also be asked to walk through your projects, explain design decisions, challenges faced, technologies used — especially if you have internship or prior experience.
Beyond pure technical skills, Tech Mahindra evaluates:
Given the process, here are smart prep tips:
A process is an independent execution unit with its own memory space, while a thread is a lightweight unit that exists inside a process and shares its resources. Context switching is heavier for processes and lighter for threads. Multithreading improves responsiveness but increases synchronization challenges. Understanding this is essential for OS-based system design.
Deadlock occurs when multiple processes wait for resources locked by each other. It happens when four conditions exist simultaneously — mutual exclusion, hold-and-wait, no pre-emption, and circular wait. Deadlock can be handled using avoidance, detection, recovery, or prevention strategies. Banker’s algorithm is one popular avoidance technique.
Paging splits memory into fixed-size blocks, while segmentation divides it into variable logical sizes. Paging avoids external fragmentation but suffers internal fragmentation. Segmentation mirrors logical program structure like code/data/stack. Combined paged segmentation is used in many OS.
When multiple threads access shared data simultaneously and the output depends on timing, a race condition occurs. It can cause unpredictable results or data corruption. Synchronization techniques like mutex locks or semaphores prevent it. Understanding race conditions is crucial for concurrency control.
Polymorphism enables a method to behave differently based on the object calling it. Compile-time polymorphism uses method overloading while runtime uses overriding via inheritance. It leads to extensible and maintainable designs. Virtual functions are key in C++ and dynamic dispatch in Java.
Shallow copy duplicates references to objects, not the actual objects. Deep copy creates an independent clone of all values and referenced objects. Shallow copying can cause unintended side effects when the original changes. Deep copy is expensive but safe.
Abstraction hides complex implementation and exposes only essential features. Encapsulation wraps data and methods inside a single unit and restricts external access. Both improve security and maintainability, but serve different purposes. Abstraction focuses on “what” while encapsulation focuses on “how”.
Dynamic binding resolves function calls at runtime instead of compile-time. It enables runtime polymorphism where overridden methods are selected based on objects, not references. It is implemented using virtual tables (C++) and dynamic dispatch (Java). Helps build flexible system architectures.
ACID guarantees reliable transactions — Atomicity, Consistency, Isolation, and Durability. They ensure that even during crashes or power failures, database integrity remains preserved. Isolation controls concurrency using levels like Read Committed or Serializable. Durability ensures committed operations are not lost.
Normalization reduces redundancy and improves data integrity. 1NF removes repeating groups, 2NF removes partial dependency, and 3NF removes transitive dependency. BCNF adds further rules for functional dependencies. However, over-normalization might degrade performance for analytical queries.
B-Trees maintain sorted data and allow logarithmic search, insertion, and deletion. Its multi-way branching keeps tree height small even for large datasets. Databases use B-Trees for indexing to minimize costly disk I/O. B+ Trees store data only in leaf nodes for faster scanning.
Primary key enforces uniqueness and disallows nulls, whereas a unique key also enforces uniqueness but allows a single null. A table has only one primary key but multiple unique constraints. Both improve query performance via indexing.
Concurrency control ensures simultaneous transactions don’t corrupt data. It uses locking (pessimistic), timestamp ordering (optimistic), and multiversion concurrency (MVCC). Deadlocks and starvation must be handled. Serializable isolation is safest but slowest.
REST uses HTTP methods to perform CRUD operations on resources. It follows statelessness and uniform interface principles. JSON is the commonly used data format. REST APIs are scalable, lightweight, and ideal for microservices.
Multithreading executes multiple threads concurrently to utilize CPU effectively. Critical sections require synchronization to avoid race conditions. Thread lifecycle includes new, runnable, blocked, and terminated states. Executors framework improves thread management.
Java automatically frees unused objects via garbage collectors such as Serial GC, Parallel GC, and G1. GC runs in young and old generational spaces. Stop-the-world pauses can affect latency. Memory leaks still occur when references are unintentionally retained.
Pointers store memory addresses and can be incremented or decremented based on data type size. Misuse may cause segmentation faults or memory corruption. Pointer arithmetic is powerful but unsafe. Understanding it improves low-level programming skills.
STL in C++ provides templates based on compile-time type checking while Java Collections use generics. STL offers algorithms and containers like vector, map, and list. Java Collections include ArrayList, HashMap, LinkedList, and more. STL is faster for competitive programming; Collections are deeply integrated with JVM.
Stack is used for local variables and function calls while heap is used for dynamically allocated memory. Stack is faster but limited in size; heap is large but slower. Heap memory requires manual free/delete in C++ and automatic GC in Java.
TCP is connection-oriented and reliable, ensuring delivery, ordering, and error recovery. UDP is connectionless, faster, and suitable for real-time apps like gaming and streaming. TCP requires handshaking (3-way handshake) while UDP does not.
Subnetting divides a network into multiple segments to improve routing efficiency and security. It reduces broadcast domain size and optimizes IP address utilization. CIDR notation (e.g., /24) defines subnet mask size.
TLS encrypts communication using handshake, certificate validation, symmetric encryption, and hashing. It prevents MITM attacks and packet sniffing. HTTPS is HTTP + TLS. Ensuring up-to-date TLS versions is critical for security.
Waterfall is linear with fixed stages while Agile is iterative with continuous feedback. Agile adapts to changing requirements; Waterfall suits well-defined projects. Scrum is a widely used Agile framework. Tech Mahindra projects often follow Agile.
Monolith bundles all features into one deployable unit whereas microservices isolate features as independent services. Microservices offer scalability and fault isolation but add complexity in deployment and monitoring. APIs enable inter-service communication.
Load balancing distributes network or application traffic across multiple servers to prevent overload. It improves performance, availability, and fault tolerance. Algorithms include Round Robin, Least Connections, and IP Hash. Modern systems use hardware and software load balancers (e.g., Nginx, AWS ELB).
CAP states that a distributed system can guarantee only two out of three properties — Consistency, Availability, and Partition Tolerance. No system can achieve all three simultaneously during network failure. CP systems focus on consistency, while AP systems focus on availability. Databases like Cassandra (AP) and MongoDB (CP) follow it.
Containerization packages applications with dependencies inside isolated units called containers. Unlike VMs, containers share the host OS, making them lightweight and fast. Docker allows consistent deployment across environments. Kubernetes manages container orchestration.
CI/CD automates code integration, testing, deployment, and monitoring. CI catches bugs early by integrating small code changes frequently. CD enables automated deployment to staging/production. It accelerates delivery and reduces manual errors.
Public cloud is shared infrastructure managed by vendors like AWS and Azure. Private cloud is used by a single organization for enhanced security and control. Hybrid cloud combines both for cost efficiency and flexibility. Most enterprises adopt hybrid models.
Concurrency deals with structuring programs to handle multiple tasks at once, not necessarily simultaneously. Parallelism executes tasks literally at the same time using multiple processors. A concurrent system can be parallel, but parallel systems are not always concurrent. Understanding both is key in multithreaded design.
A distributed cache shares cached data across multiple servers to reduce database load and improve speed. It stores frequently accessed data in memory and syncs it among nodes. Redis, Memcached, and Hazelcast are popular. Cache invalidation strategies prevent stale data.
HashMap stores key-value pairs using hashing and buckets. Hash collisions are managed using chaining (LinkedList) and tree-based structure (Red-Black Tree after JDK 8). Rehashing is triggered when load factor exceeds threshold. Poor hash functions degrade performance to O(n).
DP solves complex problems by storing solutions to subproblems instead of recomputing. It has two strategies — Top-Down (memoization) and Bottom-Up (tabulation). It improves exponential algorithms to polynomial time but requires understanding of overlapping subproblems and optimal substructure.
Average time complexity is O(n log n), worst case O(n²) when pivot selection is poor. It uses divide-and-conquer and in-place partitioning, making it memory efficient. Randomized and median-of-three pivots reduce worst cases. It outperforms other sorts in practice due to cache locality.
Thread pooling reuses pre-created worker threads instead of creating threads repeatedly. It reduces CPU overhead and improves throughput. Java Executors and C++ Thread Pools are widely used. Ideal for scalable server-side processing.
2PC ensures distributed transaction consistency across multiple systems. Phase 1 (prepare) asks all nodes to commit or abort; Phase 2 (commit/rollback) finalizes based on votes. It avoids conflicts but suffers from blocking issues if coordinator fails.
Applications react to events generated by producers and consumed by event handlers. It improves scalability and decoupling, suitable for real-time systems. Message brokers like Kafka and RabbitMQ facilitate asynchronous communication. Eventual consistency must be considered.
IoC means objects do not control their dependencies — external frameworks provide them. Dependency Injection is the most common implementation. IoC improves testability and reduces tight coupling. Spring Framework heavily uses IoC.
SQL stores structured data with strict schema, supporting ACID transactions. NoSQL handles unstructured/semi-structured data with flexible schema and horizontal scaling. SQL suits financial/crucial apps, NoSQL suits analytics, IoT, and high-load systems.
A memory leak occurs when an application allocates memory but fails to release it even after use. It gradually consumes RAM and slows down systems. Common in C++ due to manual memory management; possible in Java due to lingering references. Tools like Valgrind and VisualVM help detection.
DNS lookup → TCP handshake → TLS handshake (if HTTPS) → HTTP request → Server processing → HTTP response → Page rendering. Each step involves caching, routing, and load balancing. Understanding this demonstrates deep networking knowledge.
Rate limiting restricts the number of API calls clients can make within time windows. It protects servers from overload and abuse. Common strategies include fixed window, sliding window, and token bucket algorithms. Essential for SaaS and microservices.
JWT (JSON Web Token) securely transmits user identity using signed tokens. It consists of header, payload, and signature. Stateless authentication eliminates server-side session storage while ensuring trust. Token expiration prevents misuse.
Referential integrity ensures foreign keys correctly reference primary keys and prevent orphan records. It maintains relational consistency across tables. Cascading delete/update rules automate dependency enforcement.
Mutex is a locking mechanism allowing only one thread to access a resource at a time. Semaphores allow limited number of threads (counting mechanism). Mutex has ownership while semaphore does not. Correct usage prevents deadlocks.
Circuit breaker stops calling a failing service to prevent cascading failures. States include Closed → Open → Half Open based on service health. Widely used in microservices for resiliency. Implemented via Hystrix, Resilience4j.
Monotonic Stack maintains elements either always increasing or decreasing during traversal. It efficiently solves problems like Next Greater Element or Histogram Area in O(n) time. Helps reduce nested loops in optimization problems.
A Bloom filter is a probabilistic data structure used to test membership with small memory footprint. It can produce false positives but never false negatives. Used in caching, databases, and Big Data systems like HBase.
Latency is the time taken to process one request, while throughput is the number of requests handled per second. Low latency is crucial for responsiveness; high throughput is essential for scalability. Systems must balance both based on use cases.
Message queues (RabbitMQ, SQS) handle asynchronous task processing with guaranteed delivery. Stream platforms (Kafka, Flink) handle real-time continuous data flows. Queues focus on reliability; streams focus on high-speed event analytics.
Write a code that checks if a given integer is positive or negative
Write a code to find the sum of numbers in a given range, where the range is defined by two integer inputs num1 and num2
Write a program to determine if a given number is a prime number, considering that a prime number can only be divided by 1 and itself
Write a program that reverses a given number.
Write a program to find the factors of a given number
Write a program to find all possible palindromic partitions of a given string.
Write a program to find the largest and smallest element in an array.
Write a program to find the sum of elements in an array.
Write a program to find the frequency of elements in an array.
Write a program to check if a given string is a palindrome or not.
Write a program to remove spaces from a string.
Write a program to solve the trapping rainwater problem, where the goal is to calculate the amount of rainwater that can be trapped between bars in an elevation map
Write a program that implements Kadane’s Algorithm to find the largest contiguous subarray sum efficiently
Implement a code to merge intervals, combining overlapping or adjacent intervals into a consolidated set.
Write a program to count the number of inversions in an array
Write a program that performs a linear search to find the position of a given element in an array
Write a program that implements the insertion sort algorithm to sort an array in ascending order.
Write a program that inserts a new node at the end of a singly linked list
Write a program that performs insertion and deletion operations on a linked list
Write a program that prints the reverse of a linked list without actually modifying the original list
Write a program that reverses a linked list in groups of a given size.
Write a program that checks whether a linked list is a palindrome or not
Write a program to insert a new node in the middle of a doubly linked list
Write a program to split a circular linked list into two halves, maintaining the circular structure
Create a program to convert an infix expression to postfix notation
Write a program to reverse the elements of a queue
Implement a circular queue using linked lists
Write a program to perform an inorder tree traversal on a binary tree without using recursion
Implement a program to search for a specific node in a binary search tree
Write a program to construct a binary tree using the given postorder and inorder traversal sequences