Indian IT services
Mastech Holdings Java Developer Interview: Rounds, Questions and Preparation
For Java Developer roles at companies like Mastech Holdings
What the job involves
Java Developers in Indian IT services firms build, test, and maintain backend components for client projects, often working on Spring Boot microservices, REST APIs, and database integrations. Freshers typically join a project team, fix bugs, write basic CRUD logic, and learn the client's codebase under a senior developer's guidance. The role also involves daily stand-ups, status updates to leads, and occasional client-facing coordination depending on the project.
Role and Technical Knowledge
- 1
Explain the difference between ArrayList and LinkedList in Java, and when you would use each.
Cover internal data structures, performance for get vs add/remove, and give a practical example like frequent insertions at the start favoring LinkedList.
- 2
What is the difference between an abstract class and an interface in Java 8 and later?
Mention default and static methods in interfaces, multiple inheritance of type, and when to choose one over the other in a Spring Boot service layer.
- 3
How does a Spring Boot application start, and what is the role of @SpringBootApplication?
Explain the main method, embedded server, component scanning, auto-configuration, and how it combines @Configuration, @EnableAutoConfiguration, and @ComponentScan.
- 4
Write a SQL query to find the second highest salary from an Employee table.
Show a subquery with MAX or use ORDER BY with LIMIT/OFFSET, and explain how it would be called from a Spring Data JPA repository.
Practical Scenarios
- 5
You are asked to fix a bug in a REST API that returns 500 errors only for some users. How do you approach it?
Describe checking logs, reproducing with the same input, adding exception handling, and writing a unit test to confirm the fix before raising a pull request.
- 6
Your senior asks you to add a new field to an existing database table and expose it through an API. What steps do you take?
Cover updating the entity, writing a migration or ALTER statement, modifying the DTO, updating the controller and service, and testing with Postman.
- 7
You join a project with no documentation and a large legacy codebase. How do you start contributing?
Suggest reading the main entry points, running the application locally, tracing one API flow end to end, and asking targeted questions instead of trying to read everything.
- 8
A client reports that a scheduled job is running twice and creating duplicate records. How would you debug and prevent it?
Talk about checking scheduler configuration, adding idempotency or unique constraints, reviewing logs, and testing the fix in a lower environment before deployment.
Behavioural and HR
- 9
Tell me about a time you had to learn a new technology quickly for a college project or internship.
Use a simple STAR structure, name the technology, the deadline, the resources you used, and the outcome, keeping it honest and specific.
- 10
Are you comfortable working in rotational shifts or relocating to a client location?
Answer clearly and positively if true, and if you have constraints, state them politely while showing flexibility for the initial learning period.
- 11
Why do you want to join a services company like ours instead of a product company?
Highlight exposure to multiple domains, client-facing experience, structured training, and the chance to work on diverse technologies early in your career.
- 12
Where do you see yourself in three years as a Java Developer?
Show a realistic path: strong hands-on developer, owning modules, learning cloud or microservices, and contributing to code reviews and mentoring juniors.
Project and Coding Discussion
- 13
Walk me through your final year project and your specific contribution.
Explain the problem, your role, the tech stack, one challenge you solved, and how you tested it. Be ready to show code or a demo if asked.
- 14
How did you handle exceptions and validation in your project's backend?
Describe using try-catch, custom exceptions, @ControllerAdvice in Spring Boot, and input validation with annotations like @Valid.
- 15
If I give you a string, how would you check if it is a palindrome in Java without using library methods?
Write a simple two-pointer loop, explain time complexity, and mention edge cases like empty string, spaces, and case sensitivity.
- 16
What is the difference between a GET and a POST request, and when would you use PUT or DELETE?
Cover idempotency, safe methods, request body usage, and map each to CRUD operations in a typical Spring Boot REST controller.
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 Mastech Holdings or any other company has asked.