Have a question?
Message sent Close

Ultimate Guide to Mphasis Interview Questions for Freshers 2024

Mphasis Limited, headquartered in Bangalore, is a leading Indian multinational providing IT services and consulting. Their offerings span infrastructure technology, application outsourcing, architecture consultation, and more. Serving diverse industries like finance, telecom, logistics, and tech, Mphasis ranks 7th among Indian IT companies and 189 globally (Fortune India 500, 2019). Leveraging next-gen tech, their Front2Back Transformation strategy prioritizes customer-centricity, using cloud and cognitive capabilities to deliver personalized digital experiences. Mphasis’ Service Transformation methodology aids businesses in adapting to a digital landscape, ensuring agility in a rapidly evolving world.

At Mphasis, a collaborative culture fosters individual growth, with ample opportunities for skill development through workshops and training. Their Open Door Policy encourages open communication, providing support and fostering healthy dialogue among colleagues and supervisors.

Table of Contents

Mphasis Recruitment Process

At Mphasis, the recruitment process unfolds in multiple stages, beginning with an online test. This test covers various components:

Logical Reasoning: Your analytical and logical skills are assessed here.
Quants: This section evaluates your aptitude fundamentals.
Verbal Ability: Your grammar proficiency is analyzed in this segment.
Computer Programming: Your coding prowess is put to the test, allowing you to demonstrate your technical knowledge.

Group Discussion
The group discussion round at Mphasis is optional but crucial. It can cover a range of topics, so being prepared is key. This stage focuses on your ability to engage with others’ viewpoints and collaborate effectively within a team. You’ll need to express your stance on a given topic while also respecting the opinions of others.

Technical Interview
After clearing the online test, the next step is the technical interview at Mphasis. Here, you may face tool-based communication tests or coding challenges. You can choose to write the program in either C or C++, depending on your preference. This round aims to assess your technical skills relevant to the position. The recruiter also evaluates your problem-solving abilities and how you handle stress.

HR Interview
Following the technical interview, the next step is the HR interview at Mphasis. Here, the focus shifts to determining if you’re a good fit for the company culture. Prior to this round, it’s essential to understand the company’s leadership values and mission. Additionally, be prepared to discuss everything on your resume.

Mphasis Interview Questions for Freshers

Q1. Write a program to find the sum of the digits of a number where the input number is given in the form of a string?
Ans:

def sum_of_digits(number_str):
    total = 0
    for digit in number_str:
        total += int(digit)
    return total

# Example:
number = "12345"
print("Sum of digits:", sum_of_digits(number))  # Output: 15

Q2. Discuss the ‘extern’ keyword in C?
Ans:

  • Extern Keyword:
    • In C, the extern keyword is used to declare a variable or function that is defined in another file.
    • It informs the compiler that the variable or function is defined elsewhere in the program.
    • It is commonly used when you have multiple source files and want to use a variable or function defined in one file in another file.

Q3. Explain how the elements of a two-dimensional array are stored in the memory?
Ans: Memory Representation of 2D Array:

  • In memory, a 2D array is stored in a contiguous block of memory.
  • Elements are arranged row-wise or column-wise depending on the programming language and memory layout.
  • In row-major order, elements of each row are stored together, followed by the next row’s elements.
  • In column-major order, elements of each column are stored together, followed by the next column’s elements.

Q4. What are stable vs unstable sorting algorithms?
Ans: Stable vs Unstable Sorting Algorithms:

  • Stable Sorting:
    • Stable sorting algorithms maintain the relative order of equal elements.
    • If two elements are equal in the input, and one comes before the other, after sorting, their relative order remains the same.
    • Examples: Merge Sort, Insertion Sort, Bubble Sort.
  • Unstable Sorting:
    • Unstable sorting algorithms do not guarantee to maintain the relative order of equal elements.
    • After sorting, equal elements may change their relative positions.
    • Examples: Quick Sort, Heap Sort.

Q5. What are Marker Interfaces in Java?
Ans:

  • Marker Interfaces:
    • Marker interfaces in Java are interfaces that don’t declare any methods.
    • They are used to signify a capability or property of a class.
    • Examples: Serializable interface, Cloneable interface.
    • They act as markers for the compiler or runtime environment to perform specific operations or optimizations.

Q6. Is it possible to run a C++ application without using the OOPs concept?
Ans:

  • Yes, it is possible to write and run a C++ application without using the OOPs (Object-Oriented Programming) concept.
  • C++ supports procedural programming paradigms like C.
  • You can write functions, use control structures, and manipulate data without defining classes and objects.

Q7. List the differences between superclass and subclass in inheritance in the context of OOPs?
Ans:

  • Superclass vs Subclass:
    • Superclass:
      • Also known as a base class or parent class.
      • It’s the class from which other classes (subclasses) inherit properties and behaviors.
      • May contain common attributes and methods that subclasses inherit.
    • Subclass:
      • Also known as a derived class or child class.
      • Inherits properties and behaviors from its superclass.
      • Can have additional attributes and methods not present in the superclass.

Q8. What do the words Entity, Entity Type, and Entity Set mean in DBMS?
Ans:

  • Entity:
    • An entity is a real-world object or concept represented in a database.
    • Examples: Employee, Student, Product.
  • Entity Type:
    • An entity type is a collection of similar entities.
    • It defines the structure and attributes that all entities of that type will have.
    • Example: Employee entity type may have attributes like ID, Name, Department.
  • Entity Set:
    • An entity set is a collection of all entities of a particular entity type.
    • It represents all instances of a specific entity type in the database.
    • Example: Set of all employees in a company database.

Q9. What is regression testing in software engineering?
Ans:

  • Regression Testing:
    • Regression testing is the process of retesting a software application to ensure that recent changes or enhancements haven’t adversely affected existing features.
    • It involves running previously executed test cases again to verify that existing functionalities are still working correctly.
    • It helps in detecting and fixing bugs introduced due to code changes or system modifications.

Q10. What do you understand by a pointer-to-pointer?
Ans:

  • Pointer-to-Pointer:
    • A pointer-to-pointer in C or C++ is a pointer variable that stores the address of another pointer variable.
    • It is used to create dynamic data structures like linked lists, trees, and graphs.
    • It enables indirect access to a memory location or another pointer.
    • Example: int **ptr; declares a pointer-to-pointer that can point to an integer pointer.

Q11. Can you describe different types of keys?
Ans:

  • Types of Keys in DBMS:
    • Primary Key:
      • A primary key uniquely identifies each record in a table.
      • It must be unique and not null.
      • Each table can have only one primary key.
    • Foreign Key:
      • A foreign key is a column or set of columns in a table that references the primary key of another table.
      • It establishes a link between two tables.
    • Candidate Key:
      • A candidate key is a set of attributes that uniquely identifies tuples in a relation.
      • It can become a primary key if selected.
    • Composite Key:
      • A composite key is a key that consists of two or more attributes that uniquely identify a record.
    • Super Key:
      • A super key is a set of attributes that uniquely identifies a tuple in a relation.
      • It may contain extra attributes compared to a candidate key.

Q12. What are checkpoints and their benefits in DBMS?
Ans:

  • Checkpoints in DBMS:
    • Checkpoints are markers that indicate a specific point in a database transaction log.
    • They are used to ensure database integrity and facilitate recovery after system failures.
  • Benefits:
    • Faster Recovery: Checkpoints reduce the time required to recover the database after a system crash by providing a known recovery point.
    • Consistent Database State: Checkpoints ensure that all committed transactions are written to disk, making the database consistent.
    • Reduced Overhead: They help in reducing the overhead of the recovery process by limiting the number of transactions that need to be rolled back.

Q13. What is a VPN? List its types and advantages?
Ans:

  • VPN (Virtual Private Network):
    • A VPN is a secure network connection over a public network like the internet.
    • It allows users to securely access private networks and resources remotely.
  • Types:
    • Remote Access VPN: Allows individual users to connect to a private network remotely.
    • Site-to-Site VPN: Connects entire networks together, such as branch offices to the main corporate network.
  • Advantages:
    • Security: VPNs encrypt data to ensure privacy and prevent unauthorized access.
    • Anonymity: They hide users’ IP addresses and location, enhancing privacy and security.
    • Access Control: VPNs allow access to restricted resources based on user authentication.
    • Cost-Effectiveness: They reduce the need for dedicated leased lines, saving costs for businesses.

Q14. What is the agile software development paradigm?
Ans:

  • Agile Software Development:
    • Agile is an iterative and incremental approach to software development.
    • It emphasizes flexibility, collaboration, and customer feedback throughout the development process.
    • Agile methodologies include Scrum, Kanban, Extreme Programming (XP), etc.
    • Key principles include customer satisfaction, continuous delivery, adaptive planning, and flexible response to change.

Q15. In computer networks, what is a proxy server? How does a proxy protect computer privacy and its data?
Ans:

  • Proxy Server:
    • A proxy server acts as an intermediary between client devices and the internet.
    • It forwards requests from clients to servers and vice versa.
    • It can be used for various purposes like caching, filtering, and anonymizing.
  • Privacy Protection:
    • Proxies can hide users’ IP addresses, making their online activities anonymous.
    • They can encrypt traffic, preventing eavesdropping by malicious entities.
    • They can filter out malicious content and restrict access to unauthorized websites, enhancing security.

Q16. In the context of cloud computing, what is a private cloud?
Ans:

  • Private Cloud:
    • A private cloud is a cloud computing environment dedicated exclusively to a single organization.
    • It can be managed internally by the organization or by a third-party service provider.
    • It offers the same benefits as public cloud (scalability, flexibility) but with additional control, security, and customization options.
    • Access to resources is restricted to authorized users within the organization.

Q17. In C language, can you access the array through a pointer?
Ans:

  • Yes, in C language, you can access array elements through a pointer.
  • Arrays are internally represented as pointers to their first element.
  • Pointer arithmetic can be used to traverse array elements or access them directly.

Q18. State the uses of the function in C?
Ans:

  • Functions in C:
    • Functions in C are used to modularize code, making it easier to understand, debug, and maintain.
    • They promote code reuse by encapsulating specific tasks or operations.
    • Functions improve readability and allow abstraction of complex operations into simpler, reusable units.
    • They facilitate teamwork by enabling multiple programmers to work on different functions simultaneously.

Q19. Assume there are n people seated at a circular table with the names A, B, C, D,… Explain the concept of a deadlock in operating systems. How can deadlocks be prevented?
Ans:

  • Deadlock in Operating Systems:
    • Deadlock occurs in a system when two or more processes are unable to proceed because each is waiting for the other to release a resource.
    • In the context of the circular table scenario, deadlock can occur if each person holds a resource (like a fork) and is waiting for the resource held by the next person.
  • Prevention of Deadlocks:
    • Resource Allocation Policies: Use resource allocation policies that prevent deadlock, such as avoiding circular wait, preempting resources, or using resource hierarchy.
    • Resource Ordering: Establish a global order for resource acquisition and ensure that processes acquire resources in the same order to avoid circular waits.
    • Deadlock Detection and Recovery: Implement algorithms to detect deadlock and take appropriate actions such as resource preemption or process termination to recover from deadlock situations.

Q20. What is the difference between stack and heap memory?
Ans:

  • Stack Memory:
    • Stack memory is used for static memory allocation and contains local variables and function call information.
    • Memory allocation and deallocation are handled automatically by the compiler.
    • Stack memory is limited in size and typically smaller than heap memory.
  • Heap Memory:
    • Heap memory is used for dynamic memory allocation and contains objects allocated with malloc(), calloc(), new, etc.
    • Memory allocation and deallocation are managed manually by the programmer.
    • Heap memory is larger than stack memory and can grow as needed during program execution.

Q21. Describe what a linked list is and provide an example where it might be preferred over an array?
Ans:

  • Linked List:
    • A linked list is a linear data structure consisting of a sequence of elements called nodes.
    • Each node contains a data element and a reference (pointer) to the next node in the sequence.
    • It allows dynamic memory allocation and efficient insertion and deletion of elements.
  • Example:
    • Linked lists are preferred over arrays when:
      • Dynamic size allocation is required.
      • Constant-time insertions and deletions at any position are needed.
      • Memory needs to be allocated on demand rather than in a contiguous block.

Q22. What is the Model-View-Controller (MVC) architecture?
Ans:

  • MVC Architecture:
    • MVC is a software design pattern used for developing user interfaces.
    • It separates an application into three interconnected components: Model, View, and Controller.
    • Model: Represents the application’s data and business logic.
    • View: Represents the presentation layer, responsible for displaying data to the user.
    • Controller: Acts as an intermediary between the Model and View, handling user input and updating the Model or View accordingly.
    • It promotes modularization, reusability, and easier maintenance of code.

Q23. Discuss the significance of Git in software development and how it differs from other version control systems?
Ans:

  • Significance of Git:
    • Git is a distributed version control system widely used in software development.
    • It allows multiple developers to work on the same project simultaneously, facilitating collaboration.
    • Git provides features like branching, merging, and conflict resolution, enabling efficient code management and version control.
    • It offers robust tools for tracking changes, reverting to previous versions, and maintaining project history.
  • Difference from other VCS:
    • Distributed Nature: Git is distributed, meaning each developer has a complete copy of the repository, enhancing resilience and scalability.
    • Branching and Merging: Git’s branching and merging capabilities are more flexible and efficient compared to other version control systems.
    • Performance: Git is known for its speed and efficiency, especially in handling large repositories and complex branching structures.

Q24. What is encapsulation in object-oriented programming? Provide an example?
Ans:

  • Encapsulation:
    • Encapsulation is the bundling of data (attributes) and methods (functions) that operate on the data into a single unit (class).
    • It hides the internal state of an object and only exposes necessary functionalities through methods.
    • Encapsulation helps in achieving data abstraction and information hiding.

Example:

class Car:
    def __init__(self, make, model):
        self.make = make
        self.model = model

    def start_engine(self):
        print("Engine started")

# Creating an instance of the Car class
my_car = Car("Toyota", "Corolla")
my_car.start_engine()  # Output: Engine started

Q25. Describe the concept of multithreading in programming. What are some potential issues when using multithreads?
Ans:

  • Multithreading:
    • Multithreading is the ability of a CPU to execute multiple threads concurrently within a single process.
    • Each thread represents a separate flow of execution, allowing tasks to be performed asynchronously.
    • Multithreading is commonly used to improve performance, responsiveness, and resource utilization in applications.
  • Potential Issues:
    • Race Conditions: Concurrent access to shared resources may lead to race conditions, where the outcome depends on the timing of thread execution.
    • Deadlocks: Deadlocks can occur when two or more threads are blocked indefinitely, waiting for each other to release resources.
    • Resource Starvation: Threads may compete for limited resources, leading to starvation of certain threads.
    • Synchronization Overhead: Synchronizing access to shared resources adds overhead and may impact performance.

Q26. Explain the concept of inheritance in Python with a simple example?
Ans:

  • Inheritance in Python:
    • Inheritance is a feature of object-oriented programming that allows a class to inherit attributes and methods from another class.
    • The class that inherits is called a subclass or derived class, and the class from which it inherits is called a superclass or base class.
    • It promotes code reusability and supports the concept of hierarchical classification.

Example:

class Animal:
    def __init__(self, species):
        self.species = species

    def speak(self):
        pass

class Dog(Animal):
    def speak(self):
        return "Woof!"

# Creating an instance of the Dog class
my_dog = Dog("Canine")
print(my_dog.species)  # Output: Canine
print(my_dog.speak())  # Output: Woof!

Q27. What are the differences between SQL and NoSQL databases? Provide examples of each type?
Ans:

  • SQL vs NoSQL Databases:
    • SQL (Relational) Databases:
      • SQL databases are table-based and use structured query language (SQL) for defining and manipulating data.
      • They follow a rigid schema, requiring predefined schema and relationships between tables.
      • Examples: MySQL, PostgreSQL, SQLite.
    • NoSQL (Non-Relational) Databases:
      • NoSQL databases are document-oriented, key-value pairs, graph databases, or wide-column stores.
      • They are schema-less, allowing flexible data models and dynamic schema changes.
      • Examples: MongoDB (Document), Redis (Key-Value), Neo4j (Graph).

Example:
SQL Example:

CREATE TABLE Employees (
    ID INT PRIMARY KEY,
    Name VARCHAR(50),
    Department VARCHAR(50)
);

NoSQL Example:

{
    "ID": 1,
    "Name": "John Doe",
    "Department": "IT"
}

Q28. What is continuous integration and continuous deployment (CI/CD)?
Ans:

  • Continuous Integration (CI):
    • Continuous Integration is a development practice where developers integrate code into a shared repository frequently.
    • Each integration is verified by automated build and test processes, ensuring early detection of integration errors.
    • It helps in identifying and fixing bugs quickly and improving overall code quality.
  • Continuous Deployment (CD):
    • Continuous Deployment is an extension of Continuous Integration, where code changes are automatically deployed to production environments after passing automated tests.
    • It aims to deliver new features, updates, and bug fixes to users rapidly and consistently.
    • CD pipelines automate the process of building, testing, and deploying applications, reducing manual intervention and deployment errors.

Q29. Explain the concept of Big O notation and provide an example of how it is used to evaluate algorithm efficiency?
Ans:

  • Big O Notation:
    • Big O notation is used to analyze the time complexity and space complexity of algorithms.
    • It describes the upper bound of the growth rate of a function in relation to the size of its input.
    • It provides a way to compare the efficiency of algorithms in terms of their worst-case performance.

Example:

Suppose we have an algorithm to search for an element in an unsorted array:

def linear_search(arr, target):
    for element in arr:
        if element == target:
            return True
    return False
  • The time complexity of this algorithm is O(n), where ‘n’ is the size of the input array.
  • It means the worst-case time taken by this algorithm grows linearly with the size of the input array.

Q30. What is the difference between calloc() and malloc() functions in C for memory allocation? Provide a brief explanation and an example of each?
Ans:

  • Difference between calloc() and malloc() in C:
    • Both calloc() and malloc() functions in C are used for dynamic memory allocation, but they have some differences:
      • calloc():
        • The calloc() function allocates memory for an array of elements, initializes all bytes to zero, and returns a pointer to the allocated memory.
        • It takes two arguments: the number of elements to allocate and the size of each element.
        • It is useful when initializing arrays or structures to zero.
      • malloc():
        • The malloc() function allocates a specified number of bytes of memory and returns a pointer to the allocated memory block.
        • It takes one argument: the size of the memory block to allocate.
        • It does not initialize the allocated memory, so the content of the memory block is indeterminate and may contain garbage values.
        • It is useful for allocating memory when initialization is not necessary.
  • Example of calloc()
#include <stdio.h>
#include <stdlib.h>
int main() {
    int *arr;
    int size = 5;
    // Allocate memory for an array of 5 integers and initialize to zero
    arr = (int *)calloc(size, sizeof(int));
    // Check if memory allocation was successful
    if (arr == NULL) {
        printf("Memory allocation failed\n");
        return 1;
    }
    
    // Print the initialized array
    for (int i = 0; i < size; i++) {
        printf("%d ", arr[i]);  // Output: 0 0 0 0 0
    }
    // Free allocated memory
    free(arr);
    return 0;
}

Example of malloc():

#include <stdio.h>
#include <stdlib.h>
int main() {
    int *ptr;
    int size = 5;
    // Allocate memory for 5 integers
    ptr = (int *)malloc(size * sizeof(int));
    // Check if memory allocation was successful
    if (ptr == NULL) {
        printf("Memory allocation failed\n");
        return 1;
    }
    // Memory is not initialized, so contents are indeterminate
    // Free allocated memory
    free(ptr);
    return 0;
}

In summary, calloc() initializes the allocated memory to zero, while malloc() does not perform any initialization.

How to apply for Mphasis?


There are multiple avenues through which you can submit your application to Mphasis. These include utilizing employment websites, accessing Mphasis’s dedicated career portal, participating in recruitment events, leveraging the employee referral system, or seeking guidance from placement professionals.

Click here to visit Mphasis official website


Explore further details about the hiring processes and interview Q&A for related companies by clicking here.

Disclaimer: The provided Mphasis interview questions and answers for freshers are for educational purposes. While they offer valuable insights, the hiring process and interview details are subject to change at the discretion of the company. Individual experiences may vary, and success depends on various factors. Candidates are encouraged to supplement this resource with thorough preparation and adaptability to specific interview scenarios.

Good luck!

Leave a Reply