
Tech Mahindra


Tech Mahindra Associate Engineer Interview Questions and Answers
Q1. What is the list and list are mutable or immutable?
Lists are a data structure in Python that can hold multiple items. They are mutable, meaning their elements can be changed.
Lists are enclosed in square brackets []
Elements in a list can be of different data types
Lists can be modified by adding, removing, or changing elements
Example: my_list = ['apple', 'banana', 'cherry']
Q2. What will you do if you win 1 cr rs lottery?
I would invest a portion of it, donate to charity and use the rest to fulfill my personal goals.
Invest a portion of the money in a diversified portfolio to ensure long-term financial stability.
Donate a portion of the money to a reputable charity to give back to the community.
Use the remaining money to fulfill personal goals such as traveling, buying a house, or pursuing a hobby.
Consult with a financial advisor to make informed decisions about investing the money.
Q3. Write program on Armstrong number
Program to check if a number is an Armstrong number or not
An Armstrong number is a number that is equal to the sum of its own digits raised to the power of the number of digits
Take input from user and calculate the sum of each digit raised to the power of the number of digits
Compare the sum with the original number to check if it is an Armstrong number or not
Q4. Explain types of datatypes
Datatypes are classifications of data items that determine the kind of operations that can be performed on them.
Primitive datatypes: int, float, char, boolean
Derived datatypes: array, pointer, structure, union
Abstract datatypes: stack, queue, tree, graph
Q5. Explain Runtime Polymorphism
Runtime polymorphism is the ability of a function to behave differently based on the object it is called with.
Runtime polymorphism is achieved through method overriding in object-oriented programming.
It allows a subclass to provide a specific implementation of a method that is already provided by its superclass.
The actual method that gets called is determined at runtime based on the type of object.
Example: Animal class has a method 'makeSound'. Dog and Cat classes extend Anim...read more
Q6. Explain Polymorphism
Polymorphism is the ability of a function or method to behave differently based on the object it is acting upon.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).
Example: Animal class with methods eat() and sleep(). Dog and Cat classes can inherit from Animal and override eat() method.
Example: Function overloading in Java where ...read more
Top HR Questions asked in Tech Mahindra Associate Engineer
Interview Process at Tech Mahindra Associate Engineer

Top Associate Engineer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

