Need help? Reach out to us
Back to library

Indian IT services

Mphasis Java Developer Interview: Rounds, Questions and Preparation

For Java Developer roles at companies like Mphasis

Share with friends

Preparing together? Send them this role's questions.

https://www.cynchrony.in/library/mphasis-java-developer

What the job involves

Java Developers in Indian IT services build and maintain enterprise applications, often working on client projects across domains like banking, insurance, or retail. Day to day, they write server-side code using Java and frameworks like Spring, integrate with databases, fix bugs, and participate in code reviews and Agile ceremonies. Freshers typically start with training on company-specific tools and then join a project team under a senior developer.

Core Java and OOP

  1. 1

    Explain the difference between abstract class and interface in Java, with an example of when you would use each.

    Highlight that abstract classes can have constructors and state, while interfaces define a contract. Give a practical example like an abstract class for a base entity and an interface for a service API.

  2. 2

    What is the difference between HashMap and Hashtable? How does HashMap handle collisions?

    Mention synchronization, null keys, and performance. For collisions, explain chaining and treeification in Java 8+.

  3. 3

    How does exception handling work in Java? What is the difference between checked and unchecked exceptions?

    Cover try-catch-finally, throw vs throws, and give examples like IOException (checked) and NullPointerException (unchecked).

  4. 4

    What are the main principles of OOP? Give a real-world example of polymorphism.

    List encapsulation, inheritance, polymorphism, and abstraction. For polymorphism, use a method overloading or overriding example like a payment gateway processing different payment types.

Frameworks and Databases

  1. 5

    What is dependency injection in Spring? How does it help in enterprise applications?

    Explain inversion of control and how it reduces tight coupling. Mention constructor vs setter injection and give a scenario like injecting a repository into a service.

  2. 6

    Write a SQL query to find the second highest salary from an Employee table.

    Use a subquery with LIMIT/OFFSET or a correlated subquery. Be ready to explain the logic and handle ties.

  3. 7

    What is the difference between GET and POST in REST APIs? When would you use each?

    GET is idempotent and used for retrieval, POST for creation. Mention security and caching differences.

  4. 8

    How would you connect a Java application to a MySQL database? Explain the steps.

    Cover JDBC driver loading, connection URL, Statement/PreparedStatement, and closing resources. Mention connection pooling for production.

Practical Scenarios and Problem Solving

  1. 9

    You are asked to fix a bug where an application crashes when a user enters a very long string. How would you approach it?

    Show a systematic approach: reproduce, check logs, validate input, add exception handling, and write a unit test. Mention defensive coding.

  2. 10

    Given an array of integers, write a Java method to find the first non-repeating element.

    Use a LinkedHashMap to maintain insertion order. Explain time and space complexity.

  3. 11

    Your team lead asks you to optimize a slow database query in a Java application. What steps would you take?

    Talk about analyzing the query plan, adding indexes, reducing joins, using pagination, and caching results. Mention profiling tools.

  4. 12

    How would you design a simple REST API for a library management system? List the endpoints.

    Cover CRUD operations for books and members, use of HTTP methods and status codes, and basic authentication. Keep it simple and structured.

Behavioural and HR

  1. 13

    Tell me about a time you worked in a team to complete a college project. What was your role?

    Use the STAR method. Focus on collaboration, your specific contribution, and how you handled disagreements.

  2. 14

    Why do you want to join the IT services sector, and how do you handle working on multiple projects or with clients?

    Show awareness of the service model, adaptability, and willingness to learn. Mention exposure to different domains as a positive.

  3. 15

    Are you willing to relocate or work in shifts? How do you manage work-life balance?

    Be honest and positive. If willing, state it clearly. For balance, mention time management and prioritization.

  4. 16

    Where do you see yourself in five years? How does this role fit into your career plan?

    Align your growth with the company, e.g., becoming a senior developer or technical lead. Show commitment to learning and certifications.

Coding round

Java Developer interviews usually include a coding round. Practise planning the solution out loud, then review code the AI writes from your plan, in Python, Java, C++, C or JavaScript.

Ready to try it for real?

Take a timed test or talk through a mock interview for this role, then see your scores.

This is practice material for Java Developer roles, written with AI. It is not a list of questions Mphasis or any other company has asked.