0% found this document useful (0 votes)
45 views11 pages

Tech Mahindra Interview Q A For Freshers

The document provides a comprehensive list of interview questions and answers for freshers applying to Tech Mahindra, covering various technical topics such as Java memory areas, object-oriented programming concepts, data structures, algorithms, and database management systems. Key concepts discussed include class vs. object, function overloading, modular programming, and types of networks. Additionally, it outlines advantages and disadvantages of database systems, as well as essential conditions for deadlock and memory fragmentation.

Uploaded by

Sayali Shardul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views11 pages

Tech Mahindra Interview Q A For Freshers

The document provides a comprehensive list of interview questions and answers for freshers applying to Tech Mahindra, covering various technical topics such as Java memory areas, object-oriented programming concepts, data structures, algorithms, and database management systems. Key concepts discussed include class vs. object, function overloading, modular programming, and types of networks. Additionally, it outlines advantages and disadvantages of database systems, as well as essential conditions for deadlock and memory fragmentation.

Uploaded by

Sayali Shardul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Tech Mahindra Interview Questions for Freshers

Tech Mahindra Technical Interview Questions for


Freshers
1. What are the different types of memory areas allocated by the Java Virtual
Machine in Java?

/
m
A. The different types of memory areas allocated by the Java Virtual Machine are as follows:

.co
● Class(Method) Area: The Class(Method) Area maintains per-class structures such
as the runtime constant pool, fields, method data, and method code

ow
● Stack: The Java Stack is where frames are stored. It manages local variables and
partial results, as well as invoking and returning methods. Each thread has its own
sn
JVM stack, which is built concurrently with the thread. Each time a method is called,
a new frame is created. When a frame's method invocation is finished, it is destroyed
r
● Program Counter (PC) Register: The address of the Java virtual machine
he

instruction presently being executed is stored in the PC (programme counter) register


● Heap: This is the runtime data location where the objects' memory is allocated.
es

Native Method Stack: Each and every native method used in the application is
.fr

present in it https://www.freshersnow.com/
w

2. Differentiate between a class and an object.


w

A. Let us first look at the definitions of a class and an object before looking at the differences
/w

between the two:


s:/

● Class: A class is the fundamental building unit of Object-Oriented Programming. It is


a user-defined data type with its own set of data members and member functions
tp

which can be accessed and used by establishing a class instance (or an object). It is
the blueprint of any item. For instance, consider the class "Accountant". There may
ht

be a lot of accounts with different names and categories, but they will all have some
similar qualities, such as balances, account holder names, and so on. The account is
the class, and the amount, as well as the account holder's name, are the properties
● Object: A class's instance is an object. Objects can be used to access all of the
class's data members and member functions. When a class is defined, no memory is
allocated; nevertheless, memory is allocated when it is instantiated (that is when an
object is formed). Consider the objects in the Account class: Savings account,
Current account, and so on.

Now that we understand what classes and objects are, let us take a look at the differences
between a class and an object:

https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers

Class Object

Class is a blueprint or an object factory. Objects are instances of classes.

It is a logical entity. Objects are physical entities.

On the creation of a class, no memory is On the creation of an object, memory

/
allocated as such. Due to not being available in is allocated. This allows for the

m
the memory, classes cannot be manipulated. manipulation of objects.

.co
There are no values in the class that can be Each object has its own set of values
linked to the field. that it is associated with.

ow
3. State the difference between the following: sn
● #include <file>
r
● #include "file"
he

A. The main difference between the two is in the search location for the included file of the
es

preprocessor. The preprocessor looks for #include "file" in the same directory as the
.fr

directive's file. Normally, this approach is used to incorporate programmatically created


header files. On the other hand, the preprocessor searches for #include <file> usually in
w

search directories pre-designated by the compiler or the IDE (Integrated Development


Environment) and not necessarily in the same directory as the directive's file. In most cases,
w

this approach is used to incorporate standard library header files.


/w

4. What do you understand by Function Overloading?


s:/

A. Object-Oriented programming has a feature called function overloading, which allows two
tp

or more functions to have the same name but distinct parameters. Function Overloading
occurs when a function name is overloaded with several jobs. The "Function" name should
ht

be the same in Function Overloading, but the arguments should be different. Polymorphism
is a feature of C++ that can be used to overload functions.

An example of Function Overloading in C++ is given below:

#include <bits/stdc++.h>

using namespace std;

void foo(int n) {

cout << " Integer Value: " << n << endl;

https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers

void foo(double n) {

cout << " Decimal Value " << n << endl;

/
void foo(char n) {

m
.co
cout << " Character Value" << nc << endl;

ow
int main() {

foo(40);
r sn
he

foo(452.144);
es

foo("A");
.fr

return 0; }
w

5. What are Destructors in C++? Write down the syntax for a destructor in C++.
w

A. Destructors in C++ are instance member functions that are automatically called whenever
/w

an object is destroyed. In other words, a destructor is the last function called before an
object is destroyed. It is worth noting that if an object was formed with the "new" keyword or
s:/

if the constructor used the "new" keyword to allocate memory from the heap memory or the
free store, the destructor should free the memory with the "delete" keyword.
tp
ht

Destructors are usually used to deallocate memory and do other cleanups for a class object
and its class members when the object is destroyed and are called for a class object when
that object passes out of scope or is explicitly deleted.

The syntax for a destructor in C++ is given below:

~constructor-name();

So, for example, if the name of the class is "Car", the destructor of the class would be as
follows (the name of the constructor would be "Car"):

~Car();

https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers

Copy right to https://www.freshersnow.com/

6. State some of the advantages of a DataBase Management System.

A. Some of the advantages of a DataBase Management System are as follows:

● It helps in controlling redundancy in the database


● Integrity limitations are enforced

/
● Ensure that data is consistent

m
● Easily accessible https://www.freshersnow.com/

.co
● Unauthorized access is restricted by it
● Multiple user interfaces are available
● Backup and recovery services are available

ow
● Due to the usage of queries, data extraction and processing are simple

7. What Does Modular Programming Mean?


r sn
a. Modular programming is the process of subdividing a computer program into separate
he

sub-programs.
es

A module is a separate software component. It can often be used in a variety of applications


.fr

and functions with other components of the system. Similar functions are grouped in the
same unit of programming code and separate functions are developed as separate units of
w

code so that the code can be reused by other applications.


w

Object-oriented programming (OOP) is compatible with the modular programming concept to


/w

a large extent. Modular programming enables multiple programmers to divide up the work
and debug pieces of the program independently.
s:/

8. Can you explain the difference between file structure and storage structure?
tp

A. File Structure: Representation of data into secondary or auxiliary memory say any
ht

device such as hard disk or pen drives that stores data that remains intact until manually
deleted is known as a file structure representation.

Storage Structure: In this type, data is stored in the main memory i.e RAM, and is deleted
once the function that uses this data gets completely executed.

The difference is that storage structure has data stored in the memory of the computer
system, whereas file structure has the data stored in the auxiliary memory.

9. What is a linked list?

https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers

A. A linked list is a data structure that has sequence of nodes where every node is
connected to the next node by means of a reference pointer. The elements are not stored in
adjacent memory locations. They are linked using pointers to form a chain. This forms a
chain-like link for data storage.

Each node element has two parts:

● a data field

/
m
● a reference (or pointer) to the next node.

.co
The first node in a linked list is called the head and the last node in the list has the pointer to
NULL. Null in the reference field indicates that the node is the last node. When the list is

ow
empty, the head is a null reference.

10. What is a priority queue? sn


A. A priority queue is an abstract data type that is like a normal queue but has a priority
r
he
assigned to elements. Elements with higher priority are processed before the elements with
a lower priority. In order to implement this, a minimum of two queues are required - one for
es

the data and the other to store the priority. https://www.freshersnow.com/


.fr

11. Explain what is Quick Sort algorithm?


w

A. Quick Sort algorithm has the ability to sort lists or queries quickly. It is based on the
w

principle of partition exchange sort or Divide and conquers. This type of algorithm occupies
less space, and it segregates the list into three main parts.
/w

● Elements less than the Pivot element


s:/

● Pivot element
● Elements greater than the Pivot element
tp
ht

12. Explain what is Skip list?

A. Skip list the method for data structuring, where it allows the algorithm to search, delete
and insert elements in a symbol table or dictionary. In a skip list, each element is
represented by a node. The search function returns the content of the value related to key.
The insert operation associates a specified key with a new value, while the delete function
deletes the specified key.

13. Mention what are the three laws of recursion algorithm?

A. All recursive algorithm must follow three laws

● It should have a base case

https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers

● A recursive algorithm must call itself


● A recursive algorithm must change its state and move towards the base case

14. Explain what is bubble sort algorithm?

A. Bubble sort algorithm is also referred as sinking sort. In this type of sorting, the list to be
sorted out compares the pair of adjacent items. If they are organized in the wrong order, it
will swap the values and arrange them in the correct order.

/
m
15. How many types of database languages are?

.co
A. There are four types of database languages:

ow
● Data Definition Language (DDL) e.g., CREATE, ALTER, DROP, TRUNCATE,
RENAME, etc. All these commands are used for updating the data that?s why they
sn
are known as Data Definition Language
● Data Manipulation Language (DML) e.g., SELECT, UPDATE, INSERT, DELETE,
r
he
etc. These commands are used for the manipulation of already updated data that's
why they are the part of Data Manipulation Language.
es

● DATA Control Language (DCL) e.g., GRANT and REVOKE. These commands are
used for giving and removing the user access on the database. So, they are the part
.fr

of Data Control Language.


● Transaction Control Language (TCL) e.g., COMMIT, ROLLBACK, and
w

SAVEPOINT. These are the commands used for managing transactions in the
w

database. TCL is used for managing the changes made by DML.


/w

16. Define a Relation Schema and a Relation.


s:/

A. A Relation Schema is specified as a set of attributes. It is also known as table schema. It


defines what the name of the table is. Relation schema is known as the blueprint with the
tp

help of which we can explain that how the data is organized into tables. This blueprint
ht

contains no data.

A relation is specified as a set of tuples. A relation is the set of related attributes with
identifying key attributes

See this example:

Let r be the relation which contains set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered list
of n-values t=(v1,v2, ...., vn).

17. What are the disadvantages of file processing systems?

A. Disadvantages of file processing systems are:

https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers

● Inconsistent
● Not secure
● Difficult in accessing data
● Data isolation
● Data integrity
● Limited data sharing
● Atomicity problem

/
● Data redundancy

m
● Concurrent access is not possible

.co
18. What is the difference between microkernel and macro kernel?

ow
● Micro kernel: microkernel is the kernel that runs minimal performance affecting
services for the operating system. In microkernel operating system all other
operations are performed by the processor sn
● Macro Kernel: Macro Kernel is a combination of micro and monolithic kernel.
r
he

19. What are the four necessary and sufficient conditions behind the deadlock?
es

A. These are the 4 conditions:


.fr

1. Mutual Exclusion Condition: It specifies that the resources involved are


non-sharable.
w

2. Hold and Wait Condition: It specifies that there must be a process that is holding a
w

resource already allocated to it while waiting for an additional resource that is


/w

currently being held by other processes.


3. No-Preemptive Condition: Resources cannot be taken away while they are being
s:/

used by processes
4. Circular Wait Condition: It is an explanation of the second condition. It specifies
tp

that the processes in the system form a circular list or a chain where each process in
the chain is waiting for a resource held by the next process in the chain.
ht

20. What is FCFS?

A. FCFS stands for First Come, First Served. It is a type of scheduling algorithm. In this
scheme, if a process requests the CPU first, it is allocated to the CPU first. Its
implementation is managed by a FIFO queue.

21. What is the difference between logical address space and physical address
space?

A. Logical address space specifies the address that is generated by CPU. On the other hand
physical address space specifies the address that is seen by the memory unit.

https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers

22. What is fragmentation?

A. Fragmentation is a phenomenon of memory wastage. It reduces the capacity and


performance because space is used inefficiently. https://www.freshersnow.com/

23. Explain different types of networks.

/
m
A. Below are a few types of networks:

.co
Network Name Description

ow
PAN (Personal Area Let devices connect and communicate over the range of a
Network) person. E.g. connecting Bluetooth devices.
sn
LAN (Local Area It is a privately owned network that operates within and nearby
r
he
Network) a single building like a home, office, or factory
es

MAN (Metropolitan It connects and covers the whole city. E.g. TV Cable connection
Area Network) over the city
.fr

WAN (Wide Area It spans a large geographical area, often a country or continent.
w

Network) The Internet is the largest WAN


w

GAN (Global Area It is also known as the Internet which connects the globe using
/w

Network) satellites. The Internet is also called the Network of WANs.


s:/

24. Describe the TCP/IP Reference Model


tp

A. It is a compressed version of the OSI model with only 4 layers. It was developed by the
ht

US Department of Defence (DoD) in the 1980s. The name of this model is based on 2
standard protocols used i.e. TCP (Transmission Control Protocol) and IP (Internet Protocol).

25. What are Unicasting, Anycasting, Multicasting, and Broadcasting?

● Unicasting: If the message is sent to a single node from the source then it is known
as unicasting. This is commonly used in networks to establish a new connection.
● Anycasting: If the message is sent to any of the nodes from the source then it is
known as anycasting. It is mainly used to get the content from any of the servers in
the Content Delivery System.
● Multicasting: If the message is sent to a subset of nodes from the source then it is
known as multicasting. Used to send the same data to multiple receivers.

https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers

● Broadcasting: If the message is sent to all the nodes in a network from a source
then it is known as broadcasting. DHCP and ARP in the local network use
broadcasting

Tech Mahindra HR Interview Questions for Freshers


1. Tell us something about yourself

/
m
Well, from this question, the interviewer is not expecting your life story. However, the way

.co
you project yourself for this question will tell about your personality. Remember, the rest of
the questions which would be asked by the interviewer will be based on your answer to this

ow
question. While speaking about yourself before the panel, make sure you are carrying eye
contact with each person in the panel. Also, include everything about you like, your
educational qualification, goals, hobbies, likes, dislikes, family background, etc.,
sn
2. How do you solve the problems you face in your life?
r
he

This is a simple question but yet tricky. By your response, the interviewer would know how
es

capable you are in solving the problems. Also, your problem-solving skills will be projected
here. To keep your answer simple for this question, you can explain any situation that has
.fr

happened in the past and can tell how you have solved it with your skills.
w

3. How much do you rate yourself out of 10?


w

While answering this question, analyze yourself in all the metrics which company needed,
/w

and by comparing them with you, you can rank yourself. You can say like, 'As this company
needs a person with integrity, problem-solving skills, values, good communication skills,
s:/

moreover a good personality, and all these were abiding in me. Thus, out of 10, I would rank
myself...'
tp
ht

4. Are you comfortable working for long hours like 15-18 hrs in a day?

Above all, any employer expects his/ her employee to work more as it brings good outcomes
for the company. Thus, showcase how adaptable and hard worker you are while answering
this question. As an example, you can tell your previous experiences, like how you have
faced and accomplished the given tasks within the stipulated period of time. Through this
question, the interviewer will come to know how committed you are to the assigned task.

5. Why do you wish to work in the IT field?

From the response to this question, the interviewer will get to know the desire you have to
work for in the IT field. You can keep it like this, 'As the IT has much demand and is now in
the booming state, and moreover, in everything we use since from we get up from the bed,

https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers

there is software embedded in it. And I think, as there is much need for it, why not I can be a
part of it in its making. And thus, I have decided to work in the IT field.'

6. What makes you want to work at Tech Mahindra?

Talk about your future with Tech Mahindra, and mention how esteem it is to work for the
company. Make sure, whatever you talk about the company before the panel, must be
genuine and accurate. While answering this question, you can talk about the culture, and

/
m
ethics of the organization which will create a good atmosphere to work well for the company.
If you have known about the company through the person who is working already, you can

.co
mention that and can tell what you have heard from the employee of the company.

ow
r sn
he
es
.fr
w
w
/w
s:/
tp
ht

https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers

You Can Also Check

Tech Mahindra Recruitment Tech Mahindra Internship

Tech Mahindra Off Campus Tech Mahindra Placement Papers

/
Tech Mahindra Syllabus Tech Mahindra Aptitude Question &

m
Answers

.co
Tech Mahindra Verbal Ability Questions & Reasoning Questions & Answers
Answers

ow
Aptitude Questions & Answers Verbal Ability Questions & Answers

Technical Quizzes
r sn Placement Papers
he
Free Mock Tests Tutorials
es

Freshers Jobs IT Jobs


.fr

Scholarships in India Walkins


w
w
/w
s:/
tp
ht

https://www.freshersnow.com/

You might also like