
Tech Mahindra


50+ Tech Mahindra Associate Software Engineer Interview Questions and Answers
Q1. 1) What is NullPointerExceprion and give me a example?
NullPointerException is a runtime exception that occurs when a program tries to access or use an object reference that is null.
It is a common exception in Java programming.
It is thrown when a program attempts to use an object reference that has not been initialized.
It indicates that there is an attempt to access or invoke a method on an object that is null.
Example: String str = null; str.length();
Q2. 2) Can you call the base class method without creating an instance?
Yes, by using the super() method in the derived class.
super() method calls the base class method
Derived class must inherit from the base class
Example: class Derived(Base): def method(self): super().method()
Q3. 5) What are access specifiers and what is their significance?
Access specifiers define the level of access to class members. They ensure encapsulation and data hiding in object-oriented programming.
Access specifiers are keywords used in class definitions to specify the access level of class members.
There are three access specifiers in C++: public, private, and protected.
Public members can be accessed from anywhere in the program, while private members can only be accessed within the class.
Protected members can be accessed within the cla...read more
Q4. Which is the most important gadget in your life without which life will be difficult for you
My smartphone is the most important gadget in my life.
My smartphone helps me stay connected with family and friends
I use it for work-related communication and tasks
It serves as a source of entertainment during leisure time
I can access important information and services through it
It also serves as a camera for capturing memories
Examples: iPhone, Samsung Galaxy, Google Pixel
Q5. 3) What is call by value and call hy refarance?
Call by value and call by reference are two ways of passing arguments to a function.
Call by value passes a copy of the argument value to the function.
Call by reference passes a reference to the memory location of the argument.
Call by value is used for simple data types like int, float, etc.
Call by reference is used for complex data types like arrays, structures, etc.
Q6. 4) How does C++ support Polymorphism?
C++ supports polymorphism through virtual functions and inheritance.
Polymorphism allows objects of different classes to be treated as if they were of the same class.
Virtual functions are declared in the base class and overridden in the derived class.
Dynamic binding is used to determine which function to call at runtime.
Examples include function overriding, templates, and operator overloading.
Q7. Write a programs for exceptional handling, print prime numbers till given digit, print words of a sentence in reverse order. swapping 2 digits using 2 variables, any kind of searching algorithm and few more.
Answer to a technical interview question for Associate Software Engineer position.
For exceptional handling, use try-catch block
To print prime numbers till given digit, use a loop and check for prime numbers
To print words of a sentence in reverse order, split the sentence into words and print in reverse order
To swap 2 digits using 2 variables, use arithmetic operations
For searching algorithm, use linear search or binary search depending on the data
Provide additional examples o...read more
Q8. What is the difference between encapsulation and abstraction?
Encapsulation is hiding implementation details while abstraction is hiding unnecessary details.
Encapsulation is achieved through access modifiers like private, protected, and public.
Abstraction is achieved through abstract classes and interfaces.
Encapsulation is used to protect data from outside interference.
Abstraction is used to provide a simplified view of a complex system.
Example of encapsulation: Getters and setters in a class.
Example of abstraction: A car dashboard that...read more
Q9. What is opps nd briefly about oops and variables
OOPs stands for Object-Oriented Programming. It is a programming paradigm based on the concept of objects.
OOPs is a way of organizing and designing code around objects
Variables are used to store data within an object
In OOPs, variables are also known as properties or attributes
Variables can have different access modifiers like public, private, protected
Example: A car object can have properties like color, model, and speed
Q10. What is String buffer and string builder ?
String buffer and string builder are classes in Java used for manipulating strings.
String buffer is a mutable sequence of characters that can be modified without creating a new object.
String builder is similar to string buffer but is not synchronized, making it faster in single-threaded applications.
Both classes provide methods for appending, inserting, deleting, and replacing characters in a string.
Example: StringBuffer sb = new StringBuffer("Hello"); sb.append(" World"); Sy...read more
Q11. Write a code for palindrome in any language like c c++ or c#?
Code for palindrome in any language like c c++ or c#
Take input string from user
Reverse the string
Compare original and reversed string
If same, then it is a palindrome
Q12. What is IOT, angular js, give some live examples
IOT is the interconnection of physical devices, while AngularJS is a JavaScript framework for web development.
IOT enables devices to communicate and exchange data, leading to automation and efficiency in various industries.
Examples of IOT include smart homes, wearable devices, and industrial automation.
AngularJS simplifies web development by providing a framework for building dynamic and responsive web applications.
Examples of AngularJS include Google Analytics, PayPal, and T...read more
Q13. What is oops concepts explain all ?
OOPs concepts are the fundamental principles of object-oriented programming.
Encapsulation - binding data and functions together
Inheritance - creating new classes from existing ones
Polymorphism - ability of objects to take on many forms
Abstraction - hiding implementation details
Example: A car is an object that encapsulates data like speed and functions like accelerate and brake
Example: A child class can inherit properties and methods from a parent class
Example: A shape class c...read more
Q14. What is the advantages of Spring Boot over Spring framework?
Spring Boot simplifies Spring framework development by providing auto-configuration, embedded servers, and production-ready features.
Spring Boot provides auto-configuration which reduces the need for manual configuration, making development faster and easier.
It includes embedded servers like Tomcat, Jetty, or Undertow, eliminating the need for deploying applications on external servers.
Spring Boot offers production-ready features such as metrics, health checks, and externaliz...read more
Q15. what is the purpose of for loop
For loop is used to iterate over a block of code multiple times based on a condition.
Used to execute a block of code multiple times
Iterates over a sequence of values
Can be used with arrays, lists, or ranges
Example: for(int i=0; i<5; i++) { //code block }
Q16. Explain opps and why we used opps concept?
OOPs stands for Object-Oriented Programming. It is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Inheritance: Allowing a class to inherit properties and behavior from another class.
Polymorphism: The ability for objects to be treated as instances of their parent class or their own class.
Abstraction: Hidin...read more
Q17. Why java is not said as pure OOPs language?
Java is not considered a pure OOP language because it supports primitive data types and allows for procedural programming.
Java supports primitive data types like int, double, and boolean which are not objects.
Java allows for procedural programming with features like static methods and variables.
In pure OOP languages like Smalltalk, everything is an object and there are no primitive data types or procedural features.
Q18. What are oops concepts and what is ML?
OOPs is a programming paradigm based on the concept of objects. ML is a subset of AI that enables machines to learn from data.
OOPs concepts include encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation is the process of hiding implementation details from the user.
Inheritance allows a class to inherit properties and methods from another class.
Polymorphism allows objects to take on multiple forms or behaviors.
Abstraction is the process of hiding complex implem...read more
Q19. What do you mean by ML?
ML stands for Machine Learning, a subset of artificial intelligence that focuses on the development of algorithms and models that allow computers to learn from and make predictions or decisions based on data.
ML involves training algorithms to recognize patterns in data and make decisions or predictions without being explicitly programmed.
Common techniques in ML include supervised learning, unsupervised learning, and reinforcement learning.
Examples of ML applications include r...read more
Q20. What is the difference between array and list?
Arrays have a fixed size, while lists can dynamically grow and shrink.
Arrays have a fixed size, while lists can dynamically grow and shrink.
Arrays can only store elements of the same data type, while lists can store different data types.
Arrays are accessed by index, while lists are accessed by iterators or pointers.
Examples: Array - ['apple', 'banana', 'cherry'], List - ['apple', 5, true]
Q21. What is collections in java?
Collections in Java are pre-built data structures that allow storing and manipulating groups of objects.
Collections provide a set of interfaces and classes to work with data structures like lists, sets, maps, etc.
They offer various methods to add, remove, search, sort, and iterate over elements in the collection.
Examples of collections include ArrayList, HashSet, TreeMap, etc.
Collections framework is part of the Java API and is widely used in Java programming.
It helps in writ...read more
Q22. Difference between c++ and java
C++ is a compiled language while Java is an interpreted language.
C++ is faster and more efficient than Java.
Java is platform-independent while C++ is platform-dependent.
C++ supports multiple inheritance while Java only supports single inheritance.
Java has automatic garbage collection while C++ requires manual memory management.
Java has a larger standard library than C++.
C++ is commonly used for system programming and game development while Java is commonly used for web and mo...read more
Q23. improvements in the Offical website, you want to see
I would like to see improvements in the website's user interface, search functionality, and mobile responsiveness.
Enhance user interface with modern design elements and intuitive navigation
Improve search functionality by implementing filters, sorting options, and predictive search
Optimize website for mobile devices to ensure seamless user experience on all screen sizes
Q24. How much ctc you are expecting?
I am expecting a competitive salary based on industry standards and my qualifications.
Research industry standards for Associate Software Engineer salaries
Consider my qualifications, experience, and skills when determining salary expectations
Be prepared to negotiate based on the company's offer and benefits package
Q25. Why are you using these frameworks in your project
I am using these frameworks in my project to increase efficiency, reduce development time, and ensure code quality.
Frameworks provide pre-built components and libraries that can be easily integrated into the project
They help in standardizing the codebase and following best practices
Frameworks often come with built-in security features and updates, reducing the risk of vulnerabilities
Using frameworks can also improve scalability and maintainability of the project
For example, I...read more
Q26. if clear super coder then 5.5 LPA
The salary of 5.5 LPA is offered to candidates who are clear super coders.
Demonstrate exceptional coding skills to qualify as a clear super coder.
Show proficiency in various programming languages and problem-solving abilities.
Possess a strong understanding of data structures and algorithms.
Provide examples of successful projects or coding challenges completed.
Highlight any relevant certifications or achievements in the field of software engineering.
Q27. What is Cobol? Structure of Cobol?
COBOL is a high-level programming language used primarily for business applications.
COBOL stands for Common Business-Oriented Language.
It was designed in 1959 by CODASYL and is still widely used in legacy systems.
COBOL programs are divided into four divisions: Identification, Environment, Data, and Procedure.
It uses English-like syntax and is known for its readability and self-documenting code.
Example: DISPLAY 'Hello, World!'
Q28. How to find 2nd highest no. In a sql
Use a subquery to find the second highest number in SQL
Use a subquery to select the maximum number excluding the highest number
Order the numbers in descending order and limit the result to the second row
Q29. What is method overloading in java
Method overloading in Java allows multiple methods with the same name but different parameters.
Method overloading is achieved by having methods with the same name but different parameters in a class.
The compiler determines which method to call based on the number and type of arguments passed.
Example: void print(int num) and void print(String str) are overloaded methods with different parameters.
Q30. give a speech on water pollution for 1 min
Water pollution is a serious environmental issue caused by the release of harmful substances into water bodies.
Water pollution is mainly caused by industrial waste, agricultural runoff, and improper disposal of chemicals and plastics.
It leads to the contamination of drinking water sources, harming aquatic life, and disrupting ecosystems.
Examples of water pollutants include oil spills, pesticides, heavy metals, and sewage.
Efforts to combat water pollution include implementing ...read more
Q31. Whats oops concept?
Object-oriented programming paradigm focusing on objects and classes.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Ability of a class to inherit properties and behavior from another class.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation details and showing only the necessary features.
Q32. Why you prefer java?
I prefer Java for its platform independence, strong community support, and extensive libraries.
Platform independence allows Java code to run on any device with a Java Virtual Machine (JVM)
Strong community support ensures quick resolution of issues and access to resources
Extensive libraries provide pre-built solutions for common programming tasks
Java is widely used in enterprise applications, web development, and mobile development
Q33. Speak the sentence as prompted by the chatbot
Answer the question as prompted by the chatbot
Listen carefully to the chatbot's prompt
Repeat the sentence as accurately as possible
Provide a clear and concise response to the question
Q34. Speak on a topic for 1 min
The impact of artificial intelligence on society
AI has revolutionized various industries such as healthcare, finance, and transportation
Ethical concerns surrounding AI, such as job displacement and privacy issues
Potential benefits of AI, such as improved efficiency and decision-making
Examples like self-driving cars, virtual assistants, and medical diagnosis systems
Q35. What are the types of joins??
Types of joins include inner join, outer join (left, right, full), cross join, and self join.
Inner join: Returns rows when there is a match in both tables
Outer join: Returns all rows from one table and matching rows from the other table
Cross join: Returns the Cartesian product of the two tables
Self join: Joins a table to itself
Q36. difference between C++ and C
C++ is an extension of C with additional features like classes and inheritance.
C++ supports object-oriented programming concepts like classes and inheritance, while C does not.
C++ has a more extensive standard library compared to C.
C++ allows function overloading and templates, which are not available in C.
C++ supports exception handling, while C does not have built-in support for it.
Q37. Tell me the Arch. Of k8S
Kubernetes (k8s) is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications.
Kubernetes follows a master-slave architecture where the master node controls the cluster and the worker nodes run the containers.
It uses etcd for storing configuration data, API server for communication, scheduler for assigning workloads, and controller manager for maintaining desired state.
Kubernetes allows for horizontal s...read more
Q38. what is a linked list
A linked list is a data structure consisting of nodes where each node points to the next node in the sequence.
Consists of nodes connected by pointers
Each node contains data and a reference to the next node
Can be singly linked (each node points to the next) or doubly linked (each node points to the next and previous)
Q39. What is garbage collection
Garbage collection is a process in programming where the system automatically reclaims memory occupied by objects that are no longer in use.
Garbage collection helps in managing memory efficiently by automatically deallocating memory that is no longer needed.
It reduces the risk of memory leaks and helps in preventing bugs related to manual memory management.
Examples of programming languages with garbage collection include Java, C#, and Python.
Q40. What is static in java
In Java, 'static' keyword is used to create class-level variables and methods that can be accessed without creating an instance of the class.
Static variables are shared among all instances of a class.
Static methods can be called without creating an instance of the class.
Static blocks are used to initialize static variables.
Static variables are initialized only once, at the start of the program execution.
Example: public class MyClass { static int count = 0; }
Q41. Uses of turbine and types of turbinew
Turbines are used to convert kinetic energy into mechanical energy. There are various types of turbines such as steam, gas, and hydraulic.
Turbines are used in power generation, aviation, and marine propulsion.
Steam turbines are used in thermal power plants to generate electricity.
Gas turbines are used in aircraft engines and power plants.
Hydraulic turbines are used in hydroelectric power plants.
Wind turbines are used to generate electricity from wind energy.
Turbines can be cl...read more
Q42. Explain about Oops concepts in detail
OOPs concepts are fundamental principles of object-oriented programming like Inheritance, Polymorphism, Encapsulation, and Abstraction.
Inheritance: Allows a class to inherit properties and behavior from another class.
Polymorphism: Allows objects to be treated as instances of their parent class.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Abstraction: Hides the complex implementation details and only shows the necessary features.
Q43. Technologies used in you projects?
I have experience working with technologies such as Java, Python, SQL, HTML, CSS, JavaScript, and Git in my projects.
Java
Python
SQL
HTML
CSS
JavaScript
Git
Q44. What is dependency injection
Dependency injection is a design pattern where components are given their dependencies rather than creating them internally.
Allows for easier testing by providing mock dependencies
Promotes loose coupling between components
Improves code reusability and maintainability
Examples: Constructor injection, Setter injection, Interface injection
Q45. What is AWS, and DevOps
AWS is a cloud computing platform provided by Amazon, while DevOps is a software development methodology that combines software development with IT operations.
AWS (Amazon Web Services) is a cloud computing platform that offers a wide range of services such as computing power, storage, databases, and more.
DevOps is a software development methodology that focuses on collaboration, communication, automation, and integration between software developers and IT operations professio...read more
Q46. Swap two variables, prime number
To swap two variables, use a temporary variable to store one value before swapping them.
Create a temporary variable to store one of the values
Assign the first variable to the temporary variable
Assign the second variable to the first variable
Assign the temporary variable to the second variable
Q47. Tell me avkit yourslef
I am a dedicated and passionate software engineer with experience in Java, Python, and web development.
Experienced in Java, Python, and web development technologies
Strong problem-solving skills
Excellent communication and teamwork abilities
Q48. What are pointers
Pointers are variables that store memory addresses of other variables or functions.
Pointers are used to access and manipulate memory directly.
They are commonly used in programming languages like C and C++.
Example: int *ptr; // declaring a pointer to an integer variable
Q49. 4 pillars of oops?
The 4 pillars of OOP are Inheritance, Encapsulation, Abstraction, and Polymorphism.
Inheritance: Allows a class to inherit properties and behavior from another class.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Abstraction: Hiding the complex implementation details and showing only the necessary features of an object.
Polymorphism: Ability of an object to take on many forms.
Q50. threading in python
Threading in Python allows for concurrent execution of multiple tasks within a single process.
Threading in Python is achieved using the 'threading' module.
Threads are lightweight processes that share the same memory space.
Threads can be created by subclassing the 'Thread' class and implementing the 'run' method.
Python's Global Interpreter Lock (GIL) limits the effectiveness of threading for CPU-bound tasks, but it is still useful for I/O-bound tasks.
Example: Creating and star...read more
Q51. Repeat the AI voice sentences.
The candidate is asked to repeat sentences spoken by an AI voice.
Listen carefully to the sentences spoken by the AI voice.
Repeat the sentences accurately and clearly.
Pay attention to pronunciation and intonation.
Ask for clarification if needed.
Q52. list some os names
Operating systems are software that manage computer hardware and software resources.
Windows
MacOS
Linux
iOS
Android
Q53. Terms and condition
Terms and conditions are rules and guidelines that users must agree to follow in order to use a service or product.
Terms and conditions outline the rights and responsibilities of both the user and the company providing the service.
They often include information about privacy policies, payment terms, and usage restrictions.
Users are typically required to agree to the terms and conditions before using a service or product.
Examples of terms and conditions can be found on website...read more
Top HR Questions asked in Tech Mahindra Associate Software Engineer
Interview Process at Tech Mahindra Associate Software Engineer

Top Associate Software Engineer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

