Add office photos
Mphasis logo
Engaged Employer

Mphasis

Verified
3.4
based on 8.3k Reviews
Video summary
Filter interviews by

500+ Mphasis Interview Questions and Answers

Updated 27 Feb 2025
Popular Designations

Q1. 1. All types of database commands- DDL, DML, DCL, TCL 2. Write a java code to reverse a given string or sentence 3. Questions based on a major and minor project 4. Questions based on Industrial Training/Interns...

read more
Ans.

Interview questions for Associate Software Engineer position

  • Be familiar with all types of database commands and their usage

  • Practice writing code to reverse a given string or sentence in Java

  • Be prepared to discuss major and minor projects, as well as industrial training/internship experiences

  • Have a good understanding of operating system concepts such as job scheduling, deadlock, and starvation

  • Know the differences between C++ and Java programming languages

  • Be able to implement l...read more

Add your answer
right arrow

Q2. Trapping Rain Water Problem Statement

Given a long type array/list ARR of size N, representing an elevation map where ARR[i] denotes the elevation of the ith bar, calculate the total amount of rainwater that ca...read more

Ans.

Calculate the total amount of rainwater that can be trapped in given elevation map.

  • Iterate through the array to find the maximum height on the left and right of each bar.

  • Calculate the amount of water that can be trapped above each bar by taking the minimum of the maximum heights on the left and right.

  • Sum up the trapped water above each bar to get the total trapped water for the entire elevation map.

Add your answer
right arrow
Mphasis Interview Questions and Answers for Freshers
illustration image
Q3. How can you create a Singleton class in Java?
Ans.

A Singleton class in Java ensures that only one instance of the class is created and provides a global point of access to it.

  • Use a private static instance variable to hold the single instance of the class.

  • Make the constructor private to prevent instantiation from outside the class.

  • Provide a public static method to access the single instance, creating it if necessary.

View 1 answer
right arrow
Q4. What is the difference between static and dynamic binding in object-oriented programming?
Ans.

Static binding is resolved at compile time, while dynamic binding is resolved at runtime.

  • Static binding is also known as early binding, while dynamic binding is known as late binding.

  • Static binding is achieved using method overloading, while dynamic binding is achieved using method overriding.

  • Example of static binding: function overloading in C++.

  • Example of dynamic binding: method overriding in Java.

Add your answer
right arrow
Discover Mphasis interview dos and don'ts from real experiences

Q5. Why Mphasis? What do you know about us?

Ans.

Mphasis is a leading IT solutions provider with a focus on digital transformation.

  • Mphasis has a strong presence in the banking and financial services industry, providing innovative solutions to clients such as Citibank and Standard Chartered.

  • The company has a focus on digital transformation and offers services such as cloud computing, data analytics, and artificial intelligence.

  • Mphasis has won several awards for its work in the IT industry, including the NASSCOM Customer Serv...read more

Add your answer
right arrow
Q6. What is the SQL query to fetch the first 5 characters of a string?
Ans.

The SQL query to fetch the first 5 characters of a string is achieved using the SUBSTRING function.

  • Use the SUBSTRING function in SQL to extract the first 5 characters of a string.

  • The syntax is: SELECT SUBSTRING(column_name, 1, 5) FROM table_name;

  • For example, SELECT SUBSTRING('Hello World', 1, 5) will return 'Hello'.

Add your answer
right arrow
Are these interview questions helpful?

Q7. Write a program for multiple inheritances?

Ans.

A program for multiple inheritances

  • Create a base class with common attributes and methods

  • Create derived classes that inherit from the base class

  • Use multiple inheritance to inherit from multiple base classes

  • Resolve any naming conflicts using scope resolution operator (::)

  • Example: class Derived: public Base1, public Base2 {}

  • Example: class Derived: public Base1, public Base2 { public: void method() { Base1::method(); Base2::method(); } }

View 1 answer
right arrow
Q8. What are the main return types supported in Web API?
Ans.

Main return types in Web API include HttpResponseMessage, IHttpActionResult, and void.

  • HttpResponseMessage: Represents an HTTP response message.

  • IHttpActionResult: Represents an HTTP response that can be returned from a controller action.

  • void: Indicates that the action does not return a value.

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop
Q9. How does index hunting help improve query performance?
Ans.

Index hunting helps improve query performance by reducing the number of rows that need to be scanned.

  • Indexes allow the database to quickly locate the rows that satisfy a query criteria.

  • By using indexes, the database can avoid scanning the entire table, leading to faster query execution.

  • Examples of indexes include primary keys, unique keys, and indexes on frequently queried columns.

Add your answer
right arrow

Q10. What is the difference between structure and union?

Ans.

Structure is a collection of variables of different data types while union is a collection of variables of same data type.

  • Structure allocates memory for all its variables while union allocates memory for only one variable at a time.

  • Structure is used when we need to store different types of data while union is used when we need to store only one type of data.

  • Example of structure: struct student { char name[20]; int age; float marks; };

  • Example of union: union data { int i; floa...read more

View 1 answer
right arrow

Q11. What is your definition of work-life balance?

Ans.

Work-life balance is the ability to prioritize and manage both work and personal life effectively.

  • It involves setting boundaries and managing time efficiently

  • It allows for time to pursue personal interests and hobbies

  • It reduces stress and burnout

  • Examples include flexible work hours, remote work options, and time off for personal reasons

Add your answer
right arrow
Q12. What is the difference between REST API and RESTful API?
Ans.

REST API is an architectural style, while RESTful API is an API that follows the principles of REST.

  • REST API is an architectural style that defines a set of constraints for creating web services.

  • RESTful API is an API that follows the principles of REST, such as using HTTP methods and URIs to perform actions.

  • REST API focuses on system design, while RESTful API focuses on the implementation of the API.

  • An example of a REST API is the Twitter API, which follows the REST architect...read more

Add your answer
right arrow
Q13. What is the difference between clustered and non-clustered indexes in a database management system?
Ans.

Clustered indexes physically order the data in the table, while non-clustered indexes do not.

  • Clustered indexes determine the physical order of data in the table, while non-clustered indexes do not.

  • Clustered indexes are faster for retrieval of data, as they eliminate the need for sorting, while non-clustered indexes require an additional lookup step.

  • Tables can have only one clustered index, but multiple non-clustered indexes.

  • Examples: In a phone book, the entries are physicall...read more

Add your answer
right arrow
Q14. What is the difference between an abstract class and an interface in Java?
Ans.

Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.

  • Abstract class can have constructors, member variables, and methods with implementation.

  • Interface can only have abstract methods and constants.

  • A class can implement multiple interfaces but can only extend one abstract class.

  • Example: Abstract class - Animal with abstract method 'eat', Interface - Flyable with method 'fly'.

Add your answer
right arrow

Q15. 1. What are the commands used for maven build 2. What are the different stages we have in Jenkins pipeline. 3. Resources that are built via terraform and where we store the terraform files 4. What are the merge...

read more
Ans.

Answers to DevOps Lead interview questions

  • 1. mvn clean install - builds the project

  • 2. Stages in Jenkins pipeline: Build, Test, Deploy

  • 3. Terraform builds resources like EC2 instances, S3 buckets. Terraform files are stored in version control systems like Git

  • 4. Merge conflict tools: Git merge, Git rebase, Git cherry-pick

  • 5. Git commands: git clone, git add, git commit, git push, git pull

Add your answer
right arrow

Q16. 3 types of languages pronunciation one in english language , the same words and subject in hindi and the same statements / dialogue / description in local language that was the process of interview and also it...

read more
Ans.

The question asked about pronunciations in English, Hindi, and the local language.

  • The question required knowledge of pronunciations in different languages.

  • Candidates were expected to provide examples of words or phrases in each language.

  • The question aimed to assess language proficiency and adaptability.

Add your answer
right arrow

Q17. C code to perform in-order traversal on a binary tree.

Ans.

C code for in-order traversal on a binary tree.

  • Start at the root node.

  • Traverse the left subtree recursively.

  • Visit the root node.

  • Traverse the right subtree recursively.

  • Repeat until all nodes have been visited.

  • Example code: void inorderTraversal(Node* root) { if(root != NULL) { inorderTraversal(root->left); printf("%d ", root->data); inorderTraversal(root->right); } }

View 1 answer
right arrow

Q18. What is runtime polymorphism and how do you achieve it?

Ans.

Runtime polymorphism is the ability of an object to take on multiple forms during runtime.

  • It is achieved through inheritance and method overriding.

  • The method called depends on the actual object type at runtime.

  • Example: Animal class with a speak() method, and Dog and Cat classes that inherit from Animal and override the speak() method.

  • When a Dog object calls speak(), the overridden method in the Dog class is executed.

  • When a Cat object calls speak(), the overridden method in th...read more

Add your answer
right arrow
Q19. What are the different types of locators in Selenium?
Ans.

Different types of locators in Selenium include ID, Name, Class Name, Tag Name, Link Text, Partial Link Text, XPath, and CSS Selector.

  • ID - Locate elements by their ID attribute

  • Name - Locate elements by their Name attribute

  • Class Name - Locate elements by their Class attribute

  • Tag Name - Locate elements by their HTML tag name

  • Link Text - Locate anchor elements by their exact text

  • Partial Link Text - Locate anchor elements by partial text

  • XPath - Locate elements using XML Path expre...read more

Add your answer
right arrow
Q20. What do you mean by an SQL injection attack?
Ans.

SQL injection is a type of cyber attack where malicious SQL code is inserted into input fields to manipulate a database.

  • SQL injection is a common web application security vulnerability.

  • Attackers can inject malicious SQL code into input fields to access or manipulate database data.

  • This can lead to unauthorized access, data leakage, data manipulation, and even complete database compromise.

  • Example: Entering ' OR '1'='1' into a login form to bypass authentication.

Add your answer
right arrow

Q21. Difference between Function overriding and function overloading?

Ans.

Function overriding vs function overloading

  • Function overloading is having multiple functions with the same name but different parameters

  • Function overriding is having a function in a subclass with the same name and parameters as a function in the superclass

  • Function overloading is resolved at compile-time while function overriding is resolved at runtime

Add your answer
right arrow
Q22. Can you explain the SOLID principles in Object Oriented Design?
Ans.

SOLID principles are a set of five design principles in object-oriented programming to make software designs more understandable, flexible, and maintainable.

  • S - Single Responsibility Principle: A class should have only one reason to change.

  • O - Open/Closed Principle: Software entities should be open for extension but closed for modification.

  • L - Liskov Substitution Principle: Objects of a superclass should be replaceable with objects of its subclasses without affecting the func...read more

Add your answer
right arrow
Q23. What is the difference between PermGen and MetaSpace in Java?
Ans.

PermGen is a fixed size memory space for JVM metadata in Java 7 and earlier, while MetaSpace is a memory space that dynamically resizes in Java 8+.

  • PermGen is used for storing class metadata, interned strings, and constant pool data.

  • MetaSpace is used for storing class metadata, method data, and JIT code.

  • PermGen has a fixed size and can lead to OutOfMemoryError if exceeded.

  • MetaSpace dynamically resizes based on application demand and can be limited by the operating system.

  • PermG...read more

Add your answer
right arrow
Q24. What does the @SpringBootApplication annotation do internally?
Ans.

The @SpringBootApplication annotation is used to mark the main class of a Spring Boot application.

  • Combines @Configuration, @EnableAutoConfiguration, and @ComponentScan annotations

  • Enables Spring Boot to automatically configure the application based on dependencies and classpath

  • Marks the entry point of the Spring Boot application

Add your answer
right arrow
Q25. Can you explain the lifecycle methods of React components?
Ans.

React component lifecycle methods control the behavior of components during creation, updating, and destruction.

  • Mounting: constructor, render, componentDidMount

  • Updating: render, componentDidUpdate

  • Unmounting: componentWillUnmount

Add your answer
right arrow
Q26. What is the starter dependency of the Spring Boot module?
Ans.

The starter dependency of the Spring Boot module is spring-boot-starter.

  • The starter dependency provides a set of common dependencies for a specific type of application, making it easier to get started with Spring Boot.

  • For example, spring-boot-starter-web includes dependencies for building web applications using Spring MVC.

  • Other common starter dependencies include spring-boot-starter-data-jpa for JPA data access and spring-boot-starter-test for testing.

Add your answer
right arrow
Q27. What is the purpose of using @ComponentScan in class files?
Ans.

@ComponentScan is used to automatically detect and register Spring components in the classpath.

  • Scans the specified package and its sub-packages for classes annotated with @Component, @Repository, @Service, or @Controller

  • Registers the detected classes as Spring beans for dependency injection and other Spring features

  • Reduces the need for manual bean configuration in the Spring application context

  • Can be customized with basePackageClasses, basePackages, includeFilters, and exclud...read more

Add your answer
right arrow
Q28. What do you understand by the Java Virtual Machine?
Ans.

Java Virtual Machine (JVM) is a virtual machine that enables a computer to run Java programs.

  • JVM is responsible for converting Java bytecode into machine code that can be executed by the computer's processor.

  • It provides a layer of abstraction between the Java code and the underlying hardware and operating system.

  • JVM manages memory, handles garbage collection, and provides security features for Java applications.

  • Examples of JVM implementations include Oracle HotSpot, OpenJ9, a...read more

Add your answer
right arrow

Q29. 4.When you are assigned task in beginning of the sprint what steps do you perform to take it further till completion.

Ans.

To complete a task assigned at the beginning of a sprint, I follow a set of steps.

  • I analyze the requirements and scope of the task.

  • I break down the task into smaller sub-tasks and estimate the time required for each sub-task.

  • I prioritize the sub-tasks based on their importance and dependencies.

  • I create a plan and timeline for completing the sub-tasks.

  • I communicate with the team and stakeholders to ensure everyone is on the same page.

  • I start working on the sub-tasks and track ...read more

Add your answer
right arrow

Q30. Can we change the key of dictionary. What are the criteria to select key of dictionary

Ans.

Yes, the key of a dictionary in Python can be changed. The criteria for selecting a key are immutability and uniqueness.

  • The key of a dictionary can be any immutable data type such as strings, numbers, or tuples.

  • The key must be unique within the dictionary, as duplicate keys are not allowed.

  • Changing the value of a key is allowed, but changing the key itself requires creating a new key-value pair.

  • Keys that are mutable, such as lists, cannot be used as dictionary keys.

View 1 answer
right arrow

Q31. What is dependency injection and what are the benefits?

Ans.

Dependency injection is a design pattern where objects are passed as dependencies rather than being created within a class.

  • Reduces coupling between classes

  • Increases testability and maintainability

  • Allows for easier swapping of dependencies

  • Examples: Constructor injection, Setter injection, Interface injection

Add your answer
right arrow
Q32. When can a Factory Pattern be used?
Ans.

Factory Pattern can be used to create objects without exposing the instantiation logic to the client.

  • Used when a class can't anticipate the class of objects it must create

  • Helps in creating objects without specifying the exact class of object that will be created

  • Encapsulates object creation logic in a separate class

  • Promotes loose coupling between classes

Add your answer
right arrow
Q33. What are the four necessary and sufficient conditions that lead to a deadlock?
Ans.

Four necessary and sufficient conditions for deadlock

  • Mutual exclusion: Resources cannot be shared between processes. Example: Process A holding Resource 1 and waiting for Resource 2, while Process B holding Resource 2 and waiting for Resource 1.

  • Hold and wait: Processes hold resources while waiting for others. Example: Process A holding Resource 1 and waiting for Resource 2, while Process B holding Resource 2 and waiting for Resource 3.

  • No preemption: Resources cannot be forcib...read more

Add your answer
right arrow

Q34. what is capital ? what is your insurance ? alt+tab why we use ? why you use filter in excel file ?tell me about yesterday ?

Ans.

The question covers various topics such as capital, insurance, alt+tab, filter in excel, and yesterday's activities.

  • Capital refers to the financial resources that a company or individual possesses.

  • Insurance is a contract between an individual or organization and an insurance company that provides financial protection against potential losses.

  • Alt+tab is a keyboard shortcut used to switch between open windows or applications on a computer.

  • Filter in excel is used to sort and dis...read more

Add your answer
right arrow

Q35. What do you know about process management?

Ans.

Process management involves planning, organizing, executing, and monitoring processes to achieve organizational goals.

  • It includes identifying and defining processes

  • Assigning responsibilities and resources

  • Establishing timelines and milestones

  • Monitoring progress and making adjustments as needed

  • Examples include project management, supply chain management, and quality management

Add your answer
right arrow

Q36. What is Indexing in SQL and why do we use Indexing?

Ans.

Indexing in SQL is a way to optimize database performance by creating a data structure that allows for faster retrieval of data.

  • Indexing is a technique used to quickly locate and access the rows in a database table.

  • It works by creating an ordered list of values from one or more columns in a table.

  • By using indexes, the database engine can quickly find the rows that match a certain condition without having to scan the entire table.

  • Indexes are especially useful for tables with a...read more

Add your answer
right arrow
Q37. What is the default port of Tomcat in Spring Boot?
Ans.

The default port of Tomcat in Spring Boot is 8080.

  • The default port can be changed in the application.properties file by setting server.port property.

  • To run the Spring Boot application on a different port, you can specify the port number as a command line argument.

  • For example, to run the application on port 9090, you can use the command: java -jar -Dserver.port=9090 myapp.jar

Add your answer
right arrow

Q38. Familiar languages you are going through What you learn in lockdown

Ans.

I am familiar with Java, Python, and JavaScript. During lockdown, I learned React and Node.js.

  • Familiar with Java, Python, and JavaScript

  • Learned React and Node.js during lockdown

Add your answer
right arrow
Q39. Why was a new version of Java (Java 8) needed in the first place?
Ans.

Java 8 was needed to introduce new features like lambda expressions, streams, and default methods.

  • Introduction of lambda expressions for functional programming

  • Streams API for processing collections in a functional style

  • Default methods in interfaces for backward compatibility

  • Improved performance with the introduction of the Nashorn JavaScript engine

  • Date and Time API for better handling of date and time operations

Add your answer
right arrow
Q40. In how many ways can you create a singleton pattern in Java?
Ans.

There are multiple ways to create a singleton pattern in Java, including using static initialization, lazy initialization, and enum.

  • Using static initialization: Create a private static instance of the class and a public static method to return that instance.

  • Lazy initialization: Create a private static instance of the class and a public static method to check if the instance is null before creating it.

  • Using enum: Create a singleton using enum, as enums in Java are inherently s...read more

Add your answer
right arrow
Q41. What is the difference between the Bridge Pattern and the Adapter Pattern in Java?
Ans.

Bridge Pattern decouples abstraction from implementation, while Adapter Pattern adapts an interface to another.

  • Bridge Pattern separates abstraction and implementation using composition, while Adapter Pattern adapts an interface to another without changing its original structure.

  • Bridge Pattern allows for changes in both abstraction and implementation independently, while Adapter Pattern allows incompatible interfaces to work together.

  • Bridge Pattern is more about design upfront...read more

Add your answer
right arrow
Q42. What is a bootstrap program in an operating system?
Ans.

Bootstrap program is the initial code that runs when a computer is powered on, loading the operating system into memory.

  • Bootstrap program is stored in ROM or firmware.

  • It initializes the system hardware and loads the operating system kernel into memory.

  • Examples include BIOS in PCs and UEFI in modern systems.

Add your answer
right arrow

Q43. 3. How would you show the count in a graph 📈 which gets added multiple times ? (Method of cumulative graph - like COVID numbers)

Ans.

To show count in a cumulative graph, use a line graph with time on x-axis and cumulative count on y-axis.

  • Use a line graph to show the cumulative count over time

  • Plot time on the x-axis and cumulative count on the y-axis

  • Add a label to the y-axis indicating the cumulative count

  • Use different colors or markers to differentiate between different data sets

  • Include a legend to explain the different colors/markers used

Add your answer
right arrow
Q44. What is the difference between @RestController and @Controller in Spring Boot?
Ans.

Difference between @RestController and @Controller in Spring Boot

  • 1. @Controller is used to create web MVC controllers while @RestController is used to create RESTful web services.

  • 2. @Controller returns the view to be rendered while @RestController returns the object and data is written directly to the HTTP response as JSON or XML.

  • 3. @RestController is a specialized version of @Controller that includes @Controller and @ResponseBody annotations by default.

  • 4. @RestController is ...read more

Add your answer
right arrow
Q45. What are the fundamental characteristics of a Microservices design?
Ans.

Microservices design is characterized by modularity, independence, scalability, and resilience.

  • Modularity: Microservices are designed as independent modules that can be developed, deployed, and scaled separately.

  • Independence: Each microservice operates independently and communicates with other services through APIs.

  • Scalability: Microservices allow for scaling specific components of an application based on demand.

  • Resilience: Microservices are designed to be fault-tolerant, wit...read more

Add your answer
right arrow
Q46. What are the different strategies for deploying microservices?
Ans.

Different strategies for deploying microservices include blue-green deployment, canary deployment, rolling deployment, and feature flagging.

  • Blue-green deployment involves running two identical production environments, with one serving as the active environment while the other is on standby. Traffic is switched from one environment to the other once the new version is deemed stable.

  • Canary deployment gradually rolls out a new version to a small subset of users before making it ...read more

Add your answer
right arrow

Q47. Can you create a Static method inside an Abstract class or Interface?

Ans.

Yes, you can create a static method inside an abstract class or interface.

  • Static methods can be defined in interfaces since Java 8.

  • Static methods in interfaces are used for providing utility methods that are not tied to any specific instance of the interface.

  • Static methods in abstract classes can be used for common functionality that does not require an instance of the class.

Add your answer
right arrow

Q48. What is CSAT and how it is calculated? Are you okay for 24/7 shift? How you will make customer happy?

Ans.

CSAT is a customer satisfaction metric used to measure how happy customers are with a product or service.

  • CSAT is calculated by asking customers to rate their satisfaction on a scale of 1-5 or 1-10.

  • To calculate CSAT, divide the number of satisfied customers by the total number of customers surveyed and multiply by 100.

  • I am okay for 24/7 shift and will make customers happy by actively listening to their concerns, providing timely and accurate solutions, and going above and beyo...read more

Add your answer
right arrow
Q49. What are synthetic events in React?
Ans.

Synthetic events in React are cross-browser wrappers around the browser's native events.

  • Synthetic events are created by React to normalize browser events and ensure consistent behavior across different browsers.

  • They are instances of SyntheticEvent, which is a cross-browser wrapper around the browser's native event.

  • Synthetic events have the same interface as native events but are implemented independently to work consistently across all browsers.

  • They are used in React to handl...read more

Add your answer
right arrow
Q50. When can you use the super keyword?
Ans.

The super keyword is used to refer to the parent class in Java.

  • Used to call the constructor of the parent class in the child class.

  • Used to access the parent class methods and variables.

  • Helps in achieving method overriding in inheritance.

Add your answer
right arrow

Q51. How you will fix memory overhead issues in production?

Ans.

Memory overhead issues can be fixed by optimizing code, reducing unnecessary data, and using efficient data structures.

  • Analyze code to identify memory leaks and optimize it

  • Reduce unnecessary data by removing unused variables and objects

  • Use efficient data structures like arrays instead of linked lists

  • Implement caching to reduce memory usage

  • Use garbage collection to free up memory

  • Consider using a memory profiler to identify memory usage patterns

  • Ensure proper memory allocation a...read more

Add your answer
right arrow

Q52. Entity framework to join and pull details from joinee table. Left/Right join in Entity framework

Ans.

Entity framework supports left/right join to pull details from joinee table.

  • Use LINQ to perform left/right join in Entity framework

  • Use DefaultIfEmpty() method to perform left join

  • Use join...into statement to perform right join

  • Example: var result = from employee in context.Employees

  • join department in context.Departments on employee.DepartmentId equals department.Id into empDept

  • from department in empDept.DefaultIfEmpty() select new { employee.Name, department.Name }

Add your answer
right arrow

Q53. Have you ever worked with nUnit framework?

Ans.

Yes, I have worked with nUnit framework.

  • I have used nUnit for unit testing in C# projects.

  • I am familiar with its syntax and assertions.

  • I have integrated nUnit with Visual Studio for continuous testing.

  • I have used nUnit to test both simple and complex scenarios.

  • For example, I used nUnit to test a payment processing system.

  • I also used nUnit to test a complex algorithm for data analysis.

Add your answer
right arrow
Q54. What is the difference between Spring and Spring Boot?
Ans.

Spring is a framework for building Java applications, while Spring Boot is an extension that simplifies the setup and configuration.

  • Spring is a comprehensive framework for building Java applications, providing features like dependency injection, aspect-oriented programming, and more.

  • Spring Boot is an extension of the Spring framework that aims to simplify the setup and configuration of Spring applications.

  • Spring Boot includes embedded servers, auto-configuration, and starter ...read more

Add your answer
right arrow

Q55. What is a dangling pointer?

Ans.

A dangling pointer is a pointer that points to a memory location that has been deallocated or freed.

  • Dangling pointers can cause crashes or unexpected behavior when accessed.

  • They can occur when a pointer is not set to NULL after the memory it points to is freed.

  • Example: int *ptr = malloc(sizeof(int)); free(ptr); printf('%d', *ptr);

  • In the above example, ptr becomes a dangling pointer after the memory it points to is freed.

Add your answer
right arrow

Q56. Can you create a Static local variable inside a Static method

Ans.

Yes, a static local variable can be created inside a static method.

  • Yes, a static local variable can be declared inside a static method in programming languages like C++.

  • Static local variables retain their values between function calls.

  • Example: static void myStaticMethod() { static int count = 0; count++; }

Add your answer
right arrow

Q57. How to handle customized exceptions in controller advice with example code.

Ans.

Handling customized exceptions in controller advice with example code

  • Create a custom exception class that extends RuntimeException

  • Create a controller advice class to handle exceptions globally

  • Use @ExceptionHandler annotation in the controller advice class to handle specific exceptions

  • Return a custom error response with appropriate status code and message

Add your answer
right arrow

Q58. What do you know about the Organization. For Learning which medium you should prefer Visual representation or Books?

Ans.

Visual representation is preferred for learning.

  • Visual representation helps in better understanding complex concepts

  • Visual aids like diagrams, charts, and videos can enhance learning

  • Visual learning can improve retention and recall of information

Add your answer
right arrow

Q59. How do you calculate the number of vowels and constant in string

Ans.

This question is about calculating the number of vowels and consonants in a string.

  • Iterate through each character in the string

  • Check if the character is a vowel or a consonant

  • Increment the respective count variable

  • Return the counts of vowels and consonants

View 1 answer
right arrow
Q60. What is the difference between Monolithic and Microservices Architecture?
Ans.

Monolithic architecture is a single-tiered software application where all components are tightly coupled, while microservices architecture is a distributed approach where the application is broken down into smaller, loosely coupled services.

  • Monolithic architecture has a single codebase and database, while microservices have multiple smaller services with their own codebase and database.

  • Monolithic applications are harder to scale and maintain, while microservices allow for eas...read more

Add your answer
right arrow
Q61. What is meant by Data Warehousing?
Ans.

Data Warehousing is the process of collecting, storing, and managing data from various sources for analysis and reporting.

  • Data Warehousing involves extracting data from multiple sources

  • Data is then transformed and loaded into a central repository

  • The data can be queried and analyzed for business intelligence purposes

  • Examples include using a data warehouse to analyze sales trends or customer behavior

Add your answer
right arrow
Q62. What is the garbage collector in Java?
Ans.

Garbage collector in Java is a built-in mechanism that automatically manages memory by reclaiming unused objects.

  • Garbage collector runs in the background to identify and delete objects that are no longer needed.

  • It helps prevent memory leaks and optimize memory usage.

  • Examples of garbage collectors in Java include Serial, Parallel, CMS, and G1.

Add your answer
right arrow

Q63. What is inheritance and type of inheritance

Ans.

Inheritance is a mechanism in OOP where a new class is derived from an existing class.

  • It allows the new class to inherit the properties and methods of the existing class.

  • The existing class is called the parent or base class, and the new class is called the child or derived class.

  • There are different types of inheritance: single, multiple, multilevel, and hierarchical.

  • Example: A car class can be a parent class, and a sedan class can be a child class that inherits the properties...read more

Add your answer
right arrow
Q64. What is memory protection in operating systems?
Ans.

Memory protection in operating systems is a feature that prevents a process from accessing memory that has not been allocated to it.

  • Memory protection helps prevent one process from interfering with the memory of another process.

  • It ensures that each process can only access memory that has been allocated to it.

  • Examples of memory protection mechanisms include segmentation and paging.

  • Segmentation divides memory into segments and assigns access rights to each segment.

  • Paging divide...read more

Add your answer
right arrow
Q65. Why is normalization needed in a database?
Ans.

Normalization is needed in a database to reduce data redundancy, improve data integrity, and optimize database performance.

  • Eliminates data redundancy by breaking down data into smaller tables

  • Reduces update anomalies and inconsistencies in data

  • Improves data integrity by enforcing relationships between tables

  • Optimizes database performance by reducing storage space and improving query efficiency

Add your answer
right arrow
Q66. What is the use of profiles in Spring Boot?
Ans.

Profiles in Spring Boot allow for different configurations to be applied based on the environment or specific needs.

  • Profiles can be used to define different sets of configurations for different environments such as development, testing, and production.

  • By using profiles, you can easily switch between configurations without changing the code.

  • Profiles are typically defined in application.properties or application.yml files using the 'spring.profiles.active' property.

  • You can also...read more

Add your answer
right arrow
Q67. What are the various access specifiers in Java?
Ans.

Access specifiers in Java control the visibility of classes, methods, and variables.

  • There are four access specifiers in Java: public, protected, default (no specifier), and private.

  • Public: accessible from any other class.

  • Protected: accessible within the same package or subclasses.

  • Default: accessible only within the same package.

  • Private: accessible only within the same class.

Add your answer
right arrow

Q68. What is Angular component life cycle? What are the hooks provided by Angular framework?

Ans.

Angular component life cycle includes various hooks provided by Angular framework for managing component initialization, change detection, and destruction.

  • ngOnChanges: Called when input properties of a component change

  • ngOnInit: Called once when the component is initialized

  • ngDoCheck: Called during every change detection run

  • ngAfterContentInit: Called after content (ng-content) has been projected into the component

  • ngAfterContentChecked: Called after every check of the projected ...read more

Add your answer
right arrow

Q69. What is box model in CSS? How to create responsive websites and web applications?

Ans.

The box model in CSS defines the design and layout of elements on a webpage.

  • The box model consists of content, padding, border, and margin.

  • Content is the actual content of the element, padding is the space between the content and the border, border is the border around the element, and margin is the space outside the border.

  • To create responsive websites and web applications, use media queries to adjust styles based on screen size, use flexible units like percentages or ems, a...read more

Add your answer
right arrow

Q70. Tell me something about Stock Market & Insurance

Ans.

Stock market & insurance are both financial instruments used for investment and risk management.

  • Stock market involves buying and selling of shares of publicly traded companies

  • Insurance is a contract between an individual and an insurance company to protect against financial loss

  • Both involve risk management and investment

  • Stock market investments can be insured through options and futures contracts

  • Insurance companies may invest in the stock market to generate returns for policy...read more

Add your answer
right arrow
Q71. What is a weak entity set?
Ans.

A weak entity set is an entity set that does not have sufficient attributes to form a primary key on its own.

  • Weak entity sets depend on another entity set (strong entity set) to form a primary key.

  • They have a partial key which is a set of attributes that can uniquely identify entities within the weak entity set.

  • Examples include 'Order Item' which depends on 'Order' entity set to uniquely identify each item.

  • Another example is 'Dependent' entity set which depends on 'Employee' ...read more

Add your answer
right arrow

Q72. what is ram and rom, what is control panel, shortcuts to open different different things

Ans.

RAM and ROM are types of computer memory. Control Panel is a settings menu. Shortcuts are quick ways to open programs.

  • RAM stands for Random Access Memory and is used for temporary storage of data that the computer is currently using.

  • ROM stands for Read-Only Memory and is used for permanent storage of data that cannot be changed.

  • Control Panel is a settings menu in Windows that allows users to change various system settings such as display, sound, and network settings.

  • Shortcuts...read more

Add your answer
right arrow

Q73. 2 programming questions Find the 2nd greatest in 2 different ways

Ans.

Find the 2nd greatest in 2 different ways

  • Sort the array and return the second largest element

  • Use a loop to find the largest element and then find the second largest element

  • Use a priority queue to find the second largest element

Add your answer
right arrow

Q74. What are the endpoints in WebAPI

Ans.

Endpoints are URLs that clients use to access resources in a WebAPI.

  • Endpoints are the entry points for a WebAPI.

  • They define the resources that can be accessed by clients.

  • Endpoints are identified by a URL and HTTP method.

  • Examples of endpoints include /api/users and /api/products.

  • Endpoints can have parameters that are passed in the URL or request body.

Add your answer
right arrow

Q75. What's formula used for condition based scenarios in excel? (IF, SUMIF etc)

Ans.

Excel uses IF, SUMIF, COUNTIF, AVERAGEIF, and other formulas for condition based scenarios.

  • IF formula checks if a condition is met and returns one value if true and another if false.

  • SUMIF formula adds up values in a range that meet a certain condition.

  • COUNTIF formula counts the number of cells in a range that meet a certain condition.

  • AVERAGEIF formula calculates the average of values in a range that meet a certain condition.

  • Other formulas like MAXIF, MINIF, and CONCATENATEIF ...read more

Add your answer
right arrow

Q76. If we have partitions in Databases why we need partition in informatica also??

Ans.

Partitions in Informatica help in parallel processing and improving performance.

  • Partitions in databases and Informatica serve different purposes

  • Informatica partitions help in parallel processing of data

  • Improves performance by distributing data processing across multiple nodes

  • Allows for better resource utilization and faster data processing

  • Example: Partitioning in Informatica can be used to process large volumes of data efficiently

Add your answer
right arrow

Q77. How to handle the exceptions globally in rest api Springboot

Ans.

Handle exceptions globally in Springboot REST API

  • Use @ControllerAdvice annotation to define global exception handling for all controllers

  • Create a class annotated with @ControllerAdvice and define methods to handle specific exceptions

  • Use @ExceptionHandler annotation to specify which exceptions the method should handle

  • Return appropriate HTTP status codes and error messages in the exception handling methods

Add your answer
right arrow

Q78. What annotations are included in @SpringbootApplication annotation

Ans.

The @SpringBootApplication annotation includes @Configuration, @EnableAutoConfiguration, and @ComponentScan annotations.

  • Includes @Configuration annotation to specify that the class can be used by the Spring IoC container as a source of bean definitions.

  • Includes @EnableAutoConfiguration annotation to enable Spring Boot's auto-configuration feature.

  • Includes @ComponentScan annotation to specify the base packages to scan for components.

Add your answer
right arrow

Q79. What is Change management and overall workflow of change?

Ans.

Change management is the process of planning, implementing, and monitoring changes to improve business processes.

  • Identify the need for change

  • Plan and design the change

  • Implement the change

  • Monitor and evaluate the change

  • Communicate the change to stakeholders

  • Ensure proper training and support for the change

  • Continuously improve the change process

Add your answer
right arrow

Q80. When a transaction is in process and the power is down, what would be the transaction would have been in the user account?

Ans.

The transaction would not have been completed and the user account would not have been updated.

  • Transaction would be in an incomplete state

  • User account would not reflect the transaction

  • Data integrity may be compromised

Add your answer
right arrow
Q81. What is a classloader in Java?
Ans.

A classloader in Java is a part of the Java Runtime Environment that dynamically loads Java classes into the Java Virtual Machine.

  • Classloaders are responsible for loading classes at runtime based on the fully qualified name of the class.

  • There are different types of classloaders in Java such as Bootstrap Classloader, Extension Classloader, and Application Classloader.

  • Classloaders follow a delegation model where a classloader delegates the class loading to its parent classloade...read more

Add your answer
right arrow

Q82. what is the difference between class not exception and no definition class

Ans.

A class not exception refers to a class that does not inherit from the Exception class, while a no definition class refers to a class that has not been defined or declared.

  • A class not exception does not have the built-in exception handling capabilities provided by the Exception class.

  • A no definition class means that the class has not been defined or declared in the code.

  • An example of a class not exception could be a custom class created for data manipulation, which does not n...read more

View 1 answer
right arrow

Q83. Various patterns to achieve DI (Method, Constructor, Property level)

Ans.

DI can be achieved through method, constructor, and property level patterns.

  • Method level DI involves passing dependencies as method parameters.

  • Constructor level DI involves passing dependencies as constructor parameters.

  • Property level DI involves setting dependencies as properties of an object.

  • Examples of DI frameworks that use these patterns include Spring and Unity.

  • Choosing the appropriate pattern depends on the specific use case and design considerations.

Add your answer
right arrow

Q84. What is the memory allocation for a String?

Ans.

String memory allocation is dynamic and depends on the length of the string.

  • String memory allocation is dynamic and can change based on the length of the string.

  • In Java, a String object is stored in the heap memory.

  • Each character in a String typically takes up 2 bytes of memory.

  • String objects in Java are immutable, meaning once a String object is created, it cannot be changed.

Add your answer
right arrow

Q85. What is the Data Structure ?

Ans.

Data structure is a way of organizing and storing data in a computer so that it can be accessed and modified efficiently.

  • Data structures define the way data is organized and stored in memory.

  • Examples include arrays, linked lists, stacks, queues, trees, and graphs.

  • Choosing the right data structure is crucial for efficient algorithm design and performance.

Add your answer
right arrow

Q86. Find names starting with "A" and department 2 from a list and add values into another list using java 8.

Ans.

Using Java 8, filter names starting with 'A' and in department 2 and add them to a new list.

  • Use Java 8 stream to filter names starting with 'A' and in department 2

  • Collect the filtered names into a new list

Add your answer
right arrow

Q87. How to find out if the goven two string are anagram or not

Ans.

Anagrams can be found by sorting both strings and comparing them.

  • Sort both strings alphabetically

  • Compare the sorted strings

  • If they are the same, the strings are anagrams

  • Example: 'listen' and 'silent' are anagrams

Add your answer
right arrow

Q88. 1. What is difference between ITIL V3 & V4 ?

Ans.

ITIL V4 is an updated version of ITIL V3 with a focus on agility, flexibility, and collaboration.

  • ITIL V4 introduces the Service Value System (SVS) which replaces the Service Lifecycle in V3.

  • V4 emphasizes on the importance of collaboration and communication between different departments.

  • V4 includes new practices such as Service Request Management and Problem Management.

  • V4 also includes a new certification scheme with four levels of certification.

  • V4 is designed to be more flexi...read more

Add your answer
right arrow

Q89. How do you define an "Incident"/"Change"/"Problem Task" ?

Ans.

An incident is an unplanned interruption or reduction in quality of an IT service. A change is a modification to an IT service. A problem task is a task to identify the root cause of an incident or problem.

  • An incident is an event that disrupts the normal operation of an IT service, such as a server crash or network outage.

  • A change is a planned modification to an IT service, such as upgrading software or hardware.

  • A problem task is a task to investigate the root cause of an inc...read more

Add your answer
right arrow

Q90. What is oops , what is java, what is jdbc what is packages what is

Ans.

OOPs is Object-Oriented Programming, Java is a programming language, JDBC is Java Database Connectivity, packages are used to organize classes and interfaces.

  • OOPs is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.

  • Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.

  • JDBC is a Java API that allows Jav...read more

Add your answer
right arrow

Q91. How will u manage your brakes

Ans.

I assume you mean brakes in terms of taking breaks during work. I will manage my breaks by scheduling them in advance and communicating with my team to ensure coverage.

  • Schedule breaks in advance

  • Communicate with team to ensure coverage

  • Take breaks at appropriate times to avoid disrupting workflow

View 1 answer
right arrow

Q92. What is the process you will follow once build is received?

Ans.

Upon receiving a build, I will follow a structured process to ensure thorough testing and validation.

  • Review the release notes and requirements to understand the changes and features included in the build

  • Create test cases based on the requirements and prioritize them based on criticality

  • Execute test cases manually or using automation tools to validate the build

  • Report any defects found during testing and work with developers to resolve them

  • Perform regression testing to ensure e...read more

Add your answer
right arrow

Q93. How would you do things differently than the current QA?

Ans.

I would focus on implementing automation testing and improving communication with development team.

  • Implement automation testing to increase efficiency and reduce manual errors

  • Improve communication with development team to ensure timely bug fixes

  • Create a comprehensive test plan to cover all possible scenarios

  • Regularly review and update testing processes to stay current with industry standards

Add your answer
right arrow
Q94. What are static methods in interfaces?
Ans.

Static methods in interfaces are methods that can be called without creating an instance of the interface implementation.

  • Static methods in interfaces were introduced in Java 8.

  • They are used for providing utility methods that are related to the interface but do not require an instance of the implementing class.

  • Static methods in interfaces cannot be overridden by implementing classes.

  • Example: interface MyInterface { static void myStaticMethod() { System.out.println("Static meth...read more

Add your answer
right arrow

Q95. What are the various joins in SQL?

Ans.

Various types of joins in SQL include inner join, left join, right join, and full outer join.

  • Inner join: Returns rows when there is a match in both tables.

  • Left join: Returns all rows from the left table and the matched rows from the right table.

  • Right join: Returns all rows from the right table and the matched rows from the left table.

  • Full outer join: Returns rows when there is a match in either table.

Add your answer
right arrow

Q96. How can you reverse a string that is stored in an array?

Ans.

To reverse a string stored in an array, iterate through each string and reverse it character by character.

  • Iterate through each string in the array

  • For each string, use a loop to reverse the characters

  • Store the reversed string back in the array

Add your answer
right arrow

Q97. What are the locators in selenium, Write xpath for given element Diff between find element and findelements What is smoke sanity and regression testing Black box and white box testing difference Defect life cyc...

read more
Ans.

Answers to common interview questions for Software Test Engineer position

  • Locators in Selenium are used to locate elements on a web page, such as ID, name, class name, tag name, link text, and XPath

  • Example of XPath for an element: //input[@id='username']

  • findElement() is used to find a single element on a web page, while findElements() is used to find multiple elements

  • Smoke testing is a preliminary testing to check if the software build is stable enough for further testing, San...read more

Add your answer
right arrow

Q98. What is Liskov Principle?

Ans.

Liskov Principle is a principle of object-oriented programming that states that objects of a superclass should be replaceable with objects of its subclasses without affecting the correctness of the program.

  • Named after Barbara Liskov, a computer scientist who introduced the principle in 1987

  • Also known as Liskov Substitution Principle (LSP)

  • Helps in designing classes that are easy to extend and maintain

  • Violation of LSP can lead to unexpected behavior in the program

  • Example: If a ...read more

Add your answer
right arrow

Q99. Write the program to find smaller value from 3 input

Ans.

Program to find the smallest value from 3 inputs.

  • Compare the first two inputs and store the smaller value.

  • Compare the stored value with the third input and update if smaller.

  • Return the final stored value as the smallest value.

Add your answer
right arrow

Q100. As per OFAC list what are the sanctioned countries

Ans.

The sanctioned countries as per OFAC list include Iran, North Korea, Syria, Cuba, and Venezuela.

  • Iran

  • North Korea

  • Syria

  • Cuba

  • Venezuela

View 1 answer
right arrow
1
2
3
4
5
6
Next
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Mphasis

based on 662 interviews
Interview experience
4.0
Good
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

 Publicis Sapient Logo
3.5
 • 445 Interview Questions
Adobe Logo
3.9
 • 364 Interview Questions
EXL Service Logo
3.7
 • 343 Interview Questions
L&T Technology Services Logo
3.3
 • 318 Interview Questions
Dr. Reddy's Logo
4.0
 • 258 Interview Questions
BNY Logo
3.9
 • 202 Interview Questions
View all
Recently Viewed
INTERVIEWS
WNS
200 top interview questions
REVIEWS
WNS
No Reviews
JOBS
Mphasis
No Jobs
JOBS
Mphasis
No Jobs
LIST OF COMPANIES
WNS
Locations
REVIEWS
Mphasis
No Reviews
REVIEWS
TCS
No Reviews
REVIEWS
Mphasis
No Reviews
REVIEWS
TCS
No Reviews
REVIEWS
Mphasis
No Reviews
Top Mphasis Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter