Indian IT services
ANSR Source Java Developer Interview: Rounds, Questions and Preparation
For Java Developer roles at companies like ANSR Source
What the job involves
Java Developers in Indian IT services build and maintain enterprise applications for client projects, often working with frameworks like Spring Boot and databases like MySQL or Oracle. Day to day, they write clean code, fix bugs, participate in code reviews, and coordinate with onsite teams or clients. Freshers typically start on maintenance or enhancement work before moving to development tasks.
Core Java and OOP
- 1
Explain the difference between an interface and an abstract class in Java, with an example of when you would use each.
Mention that interfaces support multiple inheritance and are for contracts, while abstract classes can hold state and partial implementation. Give a real use case like a Payment interface versus an abstract base service class.
- 2
What is the difference between ArrayList and LinkedList? When would you choose one over the other?
Cover performance: ArrayList for fast random access, LinkedList for frequent insertions or deletions. Mention memory overhead and that in most enterprise code ArrayList is the default.
- 3
How does exception handling work in Java? Explain checked vs unchecked exceptions with examples.
Define checked (compile-time, e.g., IOException) and unchecked (runtime, e.g., NullPointerException). Explain try-catch-finally and try-with-resources, and when to create custom exceptions.
- 4
What is the difference between == and .equals() in Java? How does this affect String comparison?
Explain that == compares references and .equals() compares content. Mention String pool and why you should use .equals() for strings, and override hashCode when overriding equals.
Spring Boot, REST, and Database
- 5
What are the main annotations you use in a Spring Boot REST controller? Explain @RestController, @RequestMapping, and @Autowired.
Describe how @RestController combines @Controller and @ResponseBody, how @RequestMapping maps URLs, and how @Autowired injects dependencies. Mention constructor injection as a best practice.
- 6
How do you connect a Spring Boot application to a MySQL database and perform a simple CRUD operation?
Mention application.properties for datasource URL, username, password, and JPA settings. Explain using Spring Data JPA repository interfaces and @Entity classes for CRUD.
- 7
Write a SQL query to find the second highest salary from an Employee table.
Show a subquery with MAX and less than, or use LIMIT/OFFSET. Explain the logic clearly and mention handling duplicates or NULLs.
- 8
What is the difference between GET and POST in REST? When would you use PUT and DELETE?
GET is safe and idempotent for retrieval, POST creates resources, PUT updates or replaces, DELETE removes. Mention status codes like 200, 201, 404, and 500.
Practical Scenarios and Problem Solving
- 9
You are given a Java application that throws a NullPointerException in production. How would you debug and fix it?
Talk about reading stack traces, using logs, reproducing locally, and adding null checks or Optional. Mention defensive coding and unit tests to prevent regression.
- 10
A client reports that a REST API is slow. What steps would you take to identify and improve performance?
Suggest checking database queries, adding indexes, using pagination, caching, and profiling. Mention measuring response times and reviewing N+1 query issues.
- 11
How would you design a simple employee management system with Java, Spring Boot, and a database? Outline the layers and key classes.
Describe controller, service, repository, and entity layers. Mention DTOs, validation, exception handling, and basic endpoints for create, read, update, delete.
- 12
You need to write a Java program to count the frequency of words in a large text file. How would you approach it?
Use a HashMap, read the file line by line with BufferedReader, split words, and update counts. Mention handling case sensitivity, punctuation, and memory for large files.
Behavioural and HR
- 13
Tell me about a time you worked in a team on a college project. What was your role and how did you handle disagreements?
Use STAR format: describe the project, your task, actions taken to resolve conflict, and the result. Show teamwork and communication.
- 14
Why do you want to join a services company like ANSR Source rather than a product company?
Highlight exposure to diverse clients, structured training, and learning opportunities. Mention willingness to adapt to different technologies and work with global teams.
- 15
Are you comfortable working in shifts or relocating to a different city for a client project?
Be honest but positive. If yes, state flexibility and eagerness to learn. If no, explain constraints and show willingness to adjust where possible.
- 16
Where do you see yourself in three years as a Java Developer?
Show a growth path: from fresher to independent developer, then maybe senior or technical lead. Mention learning new frameworks and contributing to design.
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 ANSR Source or any other company has asked.