Tech Mahindra Interview Q A For Freshers
Tech Mahindra Interview Q A For Freshers
/
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
Native Method Stack: Each and every native method used in the application is
.fr
present in it https://www.freshersnow.com/
w
A. Let us first look at the definitions of a class and an object before looking at the differences
/w
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
/
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
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.
#include <bits/stdc++.h>
void foo(int n) {
https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers
void foo(double n) {
/
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.
~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
/
● 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
sub-programs.
es
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
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.
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.
● 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.
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
● Pivot element
● Elements greater than the Pivot element
tp
ht
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.
https://www.freshersnow.com/
Tech Mahindra Interview Questions for Freshers
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
SAVEPOINT. These are the commands used for managing transactions in the
w
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
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).
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
2. Hold and Wait Condition: It specifies that there must be a process that is holding a
w
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
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
/
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
GAN (Global Area It is also known as the Internet which connects the globe using
/w
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).
● 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
/
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
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.
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.'
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
/
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
https://www.freshersnow.com/