Mphasis Technical Interview Questions

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

Mphasis Technical Interview Questions for Non-IT Candidates

Question 1:- What are the various types of DMBS?

Answer:-

 Relational database management system

 Hierarchical database systems

 Network database systems

 Object-oriented database systems

Read more about DataBase Management System

Question 2:- Define Database.

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.

 Void data types – There is no value available.

Question 4:- What exactly is an array?

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:

 One dimensional Array

 Two Dimensional Array

 Multiple Dimensional Array

Question 5:- What is the difference between reference and pointer?


Reference Pointer

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.

To get the value of a reference variable, no indirection An indirection operator is required


operator is necessary. You can directly access the value of a to obtain the value of a pointer
reference variable. variable.

Null values cannot be assigned to the reference variable. The reference variable can be given
a value of null.

The variable needs to be initialized at the time of It is not essential to initialise a


declaration. variable once it has been declared.

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

 PHP and so on.

Question 7:- What are various types of data structures?

Answer:-

Data structures are divided into two categories:

Linear data structure:

A linear data structure is one in which the elements of a data structure result in a sequence or a
linear list.

Examples: Arrays, Linked Lists, Stacks, Queues, and etc.

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.

Examples: Trees, graphs, and etc

Question 8:- What are the main categories of OOPs?

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

 Armstrong number in C++

 Armstrong number in Java

 Armstrong number in Python

Question 10:- Write a program to check whether a number is a strong number or not.

Answer:-

 Strong number in C

 Strong number in C++

 Strong number in Java

 Strong number in Python

Mphasis Interview Experience

Mphasis HR Interview Questions

Question 1:- Tell me about yourself.

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.

Read more about Tell me about yourself.

Question 2:- How do you manage your stress?

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.

Read more about How do you manage your stress?

Question 3:- How much salary do you expect?

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.

Read more at: How much salary do you expect?

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?

Question 5:- What motivates you to do a good job?

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.

Read more at: What motivates you to do a good job?

Mphasis Technical Interview Questions for CS/IT Candidates

Question 1:- What is a Linked List?

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.

Question 2:- What are the different forms of linked lists?

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.

For Eg. NULL <-1<-> 2<-> 3-> NULL

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

Question 4:- Define virtual functions.

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.

Question 5:- What are Abstract Class and Abstract Method?

Answer:-

 Abstract Method:

A signature but no body characterizes an abstract method.

Overriding abstract methods of the superclass in their subclass is required.

Classes that include abstract methods should be abstracted.


 Abstract Class:

The abstract class cannot be inherited by an object.

To access abstract class members, subclass or inherit the abstract class.

Abstract methods and non-abstract methods can both be found in an abstract class.

Question 6:- Define System R.

Answer:-

System R is a database management system that offers customers a high degree of data
independence and database abstraction.

It offers data management features such as triggered transactions, authorization, integrity


assertions, and data consistency guarantees.

Question 7:- What do you mean by ACID properties?

Answer:-

Transaction attributes are ACID:

A => Atomicity: The transaction is completed in one step.

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.

D => Durability: Even if the system fails, a successful transaction is reflected.

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.

Question 9:- Write the conditions for the stack.

Answer:-

 Overflow Condition : top = MaxSize – 1

 Underflow Condition : top = MinSize – 1

Question 10:- Write a program to remove brackets from an algebraic expression.

Answer:-

 Remove brackets from an algebraic expression in C

 Remove brackets from an algebraic expression in C++

 Remove brackets from an algebraic expression in Java

 Remove brackets from an algebraic expression in Python


Question 11:- What is the basic structure of a C++ program?

Answer:-

#include <stdio.h>

using namespace std;

int main()

cout<< “Hello,World!”;

return 0;

Question 12:- Give an example of while loop.

Answer:-

#include <stdio.h>

using namspace std;

int main()

int n;

cout<<“Enter the number : ”;

cin>>n;

while(n>0)

cout<<“ ”<<n;

--n;

cout<<”While loop complete”;

Question 13:- Write a program in C for Fibonacci series.

Answer:-

#include <stdio.h>

int main()

int n = 10;
int a = 0, b = 1;

// printing the 0th and 1st term

printf("%d, %d",a,b);

int nextTerm;

// printing the rest of the terms here

for(int i = 2; i < n; i++){

nextTerm = a + b;

a = b;

b = nextTerm;

printf("%d, ",nextTerm);

return 0;

Question 14:- What will be the output of the following code?

#include <bits/stdc++.h>

class A {

public:

A() {}

~A() {

throw 42;

};

int main(int argc, const char * argv[]) {

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.

Question 15:- Write a program to display current date and time.

Answer:-

#include <iostream.h>

#include <ctime.h>

#include <iomanip.h>

using namespace std;

int main()

time_t t = time(NULL);

tm* timePtr = localtime(&t);

cout << "seconds= " << (timePtr->tm_sec) << endl;

cout << "minutes = " << (timePtr->tm_min) << endl;

cout << "hours = " << (timePtr->tm_hour) << endl;

cout << "day of month = " << (timePtr->tm_mday) << endl;

cout << "month of year = " << (timePtr->tm_mon)+1 << endl;

cout << "year = " << (timePtr->tm_year)+1900 << endl;

cout << "weekday = " << (timePtr->tm_wday )<< endl;

cout << "day of year = " << (timePtr->tm_yday )<< endl;

cout << "daylight savings = " <<(timePtr->tm_isdst )<< endl;

cout << endl;

cout << endl;

cout << "Date " <<(timePtr->tm_mday)<<"/"<< (timePtr->tm_mon)+1 <<"/"<< (timePtr->tm_year)


+1900<< endl;

cout << "Time " << (timePtr->tm_hour)<<":"<< (timePtr->tm_min)<<":"<< (timePtr->tm_sec) << endl;

return 0;
}

How to Prepare for Technical Interview?

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.

4. InternshipsInterviewers ask candidates to detail their learning experience in internships, including


technologies and projects they worked on.

Technical Interview Questions and Answers

Ques 1: State the difference between heap memory and stack memory.

Ans.

Heap Memory :

 It is used to store objects.

 If heap memory gets filled then it returns java.lang.OutOfMemoryError.

 Accessing this memory is slower when compared to stack.

 Heap space is used throughout the applications.

Stack Memory :

 It is used to store the order of method execution and local variables.

 If stack memory gets filled then it returns java.lan.StackOverFlowError.

 Accessing this memory is faster when compared to heap.

 Stack space is used for methods that are currently running.

Ques 2: Explain the concept of Reentrancy?

Ans.

It is a useful, memory-saving technique for multiprogrammed timesharing systems. A Reentrant


Procedure is one in which multiple users can share a single copy of a program during the same
period. Reentrancy has 2 key aspects: The program code cannot modify itself, and the local data for
each user process must be stored separately. Thus, the permanent part is the code, and the
temporary part is the pointer back to the calling program and local variables used by that program.
Each execution instance is called activation. It executes the code in the permanent part, but has its
own copy of local variables/parameters. The temporary part associated with each activation is the
activation record. Generally, the activation record is kept on the stack.
Note: A reentrant procedure can be interrupted and called by an interrupting program, and still
execute correctly on returning to the procedure.

Ques 3: Briefly explain the approaches to develop algorithms?


Ans.

There are three major approaches to develop algorithms −

 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.

Ques 4: Difference between C and C++ ?

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

3. Since C++ supports object-oriented programming, it is capable of performing tasks like


function overloading, templates, inheritance, virtual functions, friend functions. These
features are not present in C.

4. C++ supports exception handling at the language level, in C exception handling is done in the
traditional if-else style.

5. C++ supports references, C doesn’t.

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.

Ques 5: What are Static Binding and Dynamic Binding?

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.

Ques 6: What is database partitioning?

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.

Ques 7: What is Software Configuration Management?

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.

Ques 8: Define Version Control System(VCS)?

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.

Ques 9: Write the Syntaxes for joins.

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;

Ques 10: What is role of static keyword on class member variable?

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,

1. Static variable in functions

2. Static Class Objects

3. Static member Variable in class

4. Static Methods in class

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.

Ques 11: What is the gc() method?

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()

Ques 12: What do you mean by “Trigger” in SQL?

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.

Ques 13: What is a software metric?

Ans.

Software Metrics provide measures for various aspects of software processes and software products.
They are divided into –

1. Requirement metrics: Length requirements, completeness

2. Product metrics: Lines of Code, Object-oriented metrics, design, and test metrics

3. Process metrics: Evaluate and track budget, schedule, human resources.

Ques 14: What is Inheritance? Explain the use of Inheritance?

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:-

 For Method Overriding (so runtime polymorphism can be achieved).

 For Code Reusability.

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.

Macro Kernel: Macro Kernel is a combination of micro and monolithic kernel.

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.

Ques 18: What is the ACID property in a database?

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.

Ques 19: How will you take a sentence from a user in C?

Ans.

In order to take a sentence from user(input), we have to use scanf(“%[^\n]%*c”,s)

Where, ^\n – takes input until a newline isn’t encountered.

%*c – reads new line character.

* – indicates new line character is discarded.

Ques 20: What is selection sort?

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy