Mphasis Technical Interview Questions
Mphasis Technical Interview Questions
Mphasis Technical Interview Questions
Answer:-
Database:
A database is an electronic database that contains ordered data. You can simply access, combine,
and manage it because it’s organized and kept. A DataBase Management System (DBMS) is used to
administer and monitor a database.
Question 3:- Name the four categories that the C programming language divides data types into.
Answer:-
Basic data types – Integer and floating-point data types are two forms of arithmetic data.
Enumerated data types -Types of arrays, pointers, functions, structures, and unions
Derived datatypes -Types such as arrays, pointers, functions, structures, and unions are all
available.
Answer:-
The array is a basic data structure for storing several pieces of the same datatype in a reserved and
sequential order. There are three different types of arrays:
A temporary variable that functions as a replacement for an The address of another variable is
existing variable is referred to as a reference. stored in a pointer variable.
Null values cannot be assigned to the reference variable. The reference variable can be given
a value of null.
Question 6:- What are some of the most widely used Object-Oriented Programming languages?
Answer:-
Object-Oriented Computer languages are programming languages that employ and follow the
Object-Oriented Programming paradigm, or OOPs. The following are some of the most popular
Object-Oriented Programming languages:
C++
Javascript
Python
Answer:-
A linear data structure is one in which the elements of a data structure result in a sequence or a
linear list.
Non-linear data structure: A non-linear data structure is one in which the elements of the data
structure result in nodes not being traversed in a sequential manner.
Answer:-
OOPs, or Object-Oriented Programming, consists mostly of the following four features, which you
should not overlook:
Inheritance
Encapsulation
Data Abstraction
Polymorphism
Question 9:- Write a program to check whether a number is an Armstrong number or not.
Answer:-
Armstrong number in C
Question 10:- Write a program to check whether a number is a strong number or not.
Answer:-
Strong number in C
Answer:-
I got discovered your job description as a recent graduate. According to my understanding, the
position requires a calm individual who is eager to take on new challenges. I believe I am an
excellent candidate for this role. I learned programming on my own as a Mechanical Engineering
student. I’ve created projects that you can discover on my Github, and I’m constantly learning new
skills. In my engineering class, I was an active part of the student body and served as a liaison
between students and instructors. Perhaps my greatest skill is that I never back down from a
challenge and always approach a problem square in the face. If you give me the chance. I would be a
valuable asset to your company.
Answer:-
Stress has become a strong motivator for me over time. When I understand what my supervisor
wants of me and when I am under a reasonable level of pressure, I am more productive and produce
better outcomes. I’ve also run into a few of vexing situations that have caused me to tighten my belt.
In these situations, I work twice as hard as usual, and I’ve discovered that my efforts on a task are
commendable even when I’m under duress.
Answer:-
Thank you; I’m extremely pleased about this work, and I’m confident that when we negotiate, we’ll
come to an agreement that is fair to both of us. I’m eager to learn more about the position and its
responsibilities so that I can choose an appropriate wage.
Question 4:- What was the toughest decision you ever had to make?
Answer:-
The judgments I must make inside a squad are more difficult since they take longer and need
thoughtful contact with team members. For example, while I was working on a group assignment, I
had to make a number of decisions regarding how to spend our restricted budget. Our team knew
how to readily interact with one another, and these decisions were taken in group meetings, and I
agree that we made the greatest judgments for the team individually.
Read more at: What was the toughest decision you ever had to make?
Answer:-
I am a self-driven individual. I enjoy giving it my all in all I do and successfully finishing tasks. You
would think that my greatest incentive is my ability to execute. I find that I can stay motivated
without the support of a supervisor even when working alone.
Answer:-
Linked list: A linked list (like arrays) is a linear data structure in which each entry is an independent
object. A list’s element (or node) consists of two components: data and a reference to the next
node.
Answer:-
Singly Linked List: In this sort of linked list, each node keeps the address or reference of the next
node in the list, while the last node has NULL for the next address or reference.
For Eg, 1->2->3->4-> NULL
Doubly Linked List: There are two references associated with each node in this doubly linked list,
one to the next node and one to the prior node.
Circular Linked List: A circular linked list is a linked list in which all of the nodes are connected in a
circle. At the end, there is no NULL. There are two types of circular linked lists: singly circular linked
lists and doubly circular linked lists.
Eg. 1->2->3->1 [The last node’s next pointer points to the first]
Question 3:-Write a program for a given array which consists of only 0, 1 and 2 sort the array
without using any sorting algorithm.
Answer:-
Given an array which consists of only 0, 1 and 2 sort the array without using any sorting
algorithm in C
Given an array which consists of only 0, 1 and 2 sort the array without using any sorting
algorithm in C++
Given an array which consists of only 0, 1 and 2 sort the array without using any sorting
algorithm in Java
Given an array which consists of only 0, 1 and 2 sort the array without using any sorting
algorithm in Python
Answer:
Virtual Function:
With inheritance, virtual functions are named after the type of the object pointed to or referred to,
rather than the type of pointer or reference.
A virtual function is a member function defined in a base class that is overridden by derived classes.
You can call a virtual function for a derived class object when you refer to it using a pointer or a
reference to the base class.
Virtual functions, in other words, are resolved at runtime. A function can be made virtual using the
virtual keyword.
Answer:-
Abstract Method:
Abstract methods and non-abstract methods can both be found in an abstract class.
Answer:-
System R is a database management system that offers customers a high degree of data
independence and database abstraction.
Answer:-
C => Consistency: Before and after the transaction, the database must be consistent.
I => Isolation: Transactions do not interfere with one another, and numerous transactions can occur
at the same time.
Question 8:- Is it important to generate objects from classes all of the time?
Answer:-
No. If the base class has non-static methods, an object must be constructed. However, if the class
includes static methods, no objects are required. In this situation, you can use the class name to
invoke the class method directly.
Answer:-
Answer:-
Answer:-
#include <stdio.h>
int main()
cout<< “Hello,World!”;
return 0;
Answer:-
#include <stdio.h>
int main()
int n;
cin>>n;
while(n>0)
cout<<“ ”<<n;
--n;
Answer:-
#include <stdio.h>
int main()
int n = 10;
int a = 0, b = 1;
printf("%d, %d",a,b);
int nextTerm;
nextTerm = a + b;
a = b;
b = nextTerm;
printf("%d, ",nextTerm);
return 0;
#include <bits/stdc++.h>
class A {
public:
A() {}
~A() {
throw 42;
};
try {
A a;
throw 32;
} catch(int a) {
std::cout << a;
Answer:-
If this set of code runs then it will crash or stop as it will throw 32 error as class A is a destroyer and
will throw another exception while exception handling which will cause the program to crash.
Answer:-
#include <iostream.h>
#include <ctime.h>
#include <iomanip.h>
int main()
time_t t = time(NULL);
cout << "Time " << (timePtr->tm_hour)<<":"<< (timePtr->tm_min)<<":"<< (timePtr->tm_sec) << endl;
return 0;
}
1.Any one Programming LanguagePrepare questions from at least any one of the common
programming languages (C, C++, JAVA< Python).
2. Brush up your ProjectInterviewers will most likely ask you to explain any project you have worked
on. Prepare a presentation for your project.
3. Technical SkillsRead about the latest trends in technology,including questions on AI, ML, BigData,
Crypto etc.
Ques 1: State the difference between heap memory and stack memory.
Ans.
Heap Memory :
Stack Memory :
Ans.
Greedy Approach − creating a solution by choosing the next best possible option
Divide and Conquer − diving the problem to a minimum possible sub-problem and solving
them independently.
Dynamic Programming − diving the problem to a minimum possible sub-problem and solving
them combinedly.
Ans.
1. C++ can be considered as a superset of C, most C programs except some exceptions, work in
C++ and C.
2. C programming is a little bit limited and is a procedural programming language, but C++
supports both procedural and Object-Oriented programming
4. C++ supports exception handling at the language level, in C exception handling is done in the
traditional if-else style.
6. In C, scanf() and printf() are mainly used input/output. C++ mainly uses streams to perform
input and output operations. cin is a standard input stream and cout is a standard output
stream.
Ans.
Static Binding is a binding in which the name can be combined with the class during
collection time, and it is also called early binding.
Dynamic Binding is a binding in which name can be identified with the class during execution
time, and it is also known as Late Binding.
Ans.
It (Database partitioning) is a process where a logical database is divided into different independent
parts. The database objects like tables, indexes are subdivided and managed, and accessed at the
granular level.
Ans.
During the Software Development Life Cycle, Software Configuration Management is a method for
routinely managing, organizing, and controlling modifications in manuals, protocols, and other
organizations. In information engineering, the SCM process is abbreviated as SCM. The main aim is
to improve productivity by making as few errors as possible.
Ans.
A version control system is defined as a system that keeps all records of the changes made on a
specific project, and also helps us to ensure whether all developers in a team are working on the
same or not. It manages the history of all the activities done so, it gives a developer the confidence
to fix a bug or make any changes or run a test so if anything goes wrong previous work can be
restored anytime.
Ans.
INNER JOIN: select column_name From table1 INNER JOIN table2 on table1.column_name =
table2.column_name;
OUTER JOIN: select column_name From table1 OUTER JOIN table2 on table1.column_name
= table2.column_name;
LEFT JOIN: select column_name From table1 LEFT JOIN table2 on table1.column_name =
table2.column_name;
RIGHT JOIN: select column_name From table1 RIGHT JOIN table2 on table1.column_name =
table2.column_name;
FULL JOIN: select column_name From table1 INNER JOIN table2 on table1.column_name =
table2.column_name WHERE condition;
Ans.
Static is a keyword in C++ used to give special characteristics to an element. Static elements are
allocated storage only once in a program lifetime in the static storage area. And they have a scope
till the program’s lifetime. Static Keyword can be used with the following,
A static variable does exit through the objects for the respective class are not created. Static
member variables share a common memory across all the objects created for the respective class. A
static member variable can be referred to using the class name itself.
Ans.
To invoke Garbage Collector, this gc() method is called. It is found in both system and runtime
classes. It automatically releases the memory when an object is no longer used.
Example : public static void gc()
Ans.
A trigger is a special type of stored procedure that executes automatically in place or after data
changes. It allows e executing a batch of code when an insert, update, or any other query is
executed against a specific table.
Ans.
Software Metrics provide measures for various aspects of software processes and software products.
They are divided into –
2. Product metrics: Lines of Code, Object-oriented metrics, design, and test metrics
Ans.
Inheritance is a concept where one class shares the structure and behavior defined in another class.
Inheritance applied to one class is called Single Inheritance, and if it depends on multiple classes,
then it is called multiple Inheritance.
Uses:-
Ques 15: What is the difference between micro kernel and macro kernel?
Ans.
Micro kernel: micro kernel is the kernel which runs minimal performance affecting services for
operating system. In micro kernel operating system all other operations are performed by processor.
Ques 16: What are the advantages of passing this into a method instead of the current class object
itself?
Ans.
As we know, that this refers to the current class object, therefore, it must be similar to the current
class object. However, there can be two main advantages of passing this into a method instead of
the current class object.
This is a final variable. Therefore, this cannot be assigned to any new value whereas the
current class object might not be final and can be changed.
This can be used in the synchronized block.
Ques 17: How does the throw keyword differ from the throws keyword?
Ans.
While the throws keyword allows declaring an exception, the throw keyword is used to explicitly
throw an exception. Checked exceptions can’t be propagated with throw only, but throws allow
doing so without the need for anything else. The throws keyword is followed by a class, whereas the
throw keyword is followed by an instance. The throw keyword is used within the method, but the
throws keyword is used with the method signature. Furthermore, it is not possible to throw multiple
exceptions, but it is possible to declare multiple exceptions.
Ans.
To ensure that the data transactions are processed reliably in a database system we use the ACID
property.
Atomicity: It states that each transaction is all or nothing. It states that the entire transaction
fails if one part of the transaction fails and the database state is left unchanged.
Consistency: It ensures that the data must follow all validation rules. According to this a
transaction never leaves your database without its state being completed.
Isolation: The main goal of providing isolation is concurrency control. This property ensures
that the concurrent property of execution should not be met.
Durability: this property states that once a transaction has been committed, it remains
committed, whatever the situation be, even power loss, crashes, or errors.
Ans.
Ans.
In the selection sort technique, the list is divided into two parts. In one part all elements are sorted
and in another part the items are unsorted. At first we take the maximum or minimum data from the
array. After getting the data (say minimum) we place it at the beginning of the list by replacing the
data of first place with the minimum data.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: