Interview practice

Java Backend Developer

2–5 years · Mid — Java · Spring Boot · REST APIs · JPA / Hibernate · SQL · Microservices

0–2 years 2–5 years 5–8 years 8+ years
scenario Concurrency issues 1 of 6
You discover that users are experiencing inconsistent results when accessing a shared resource in a microservice. What is your approach to identify and resolve this concurrency issue?
What a strong answer covers

Analyzes the code for shared mutable state; implements locking mechanisms or uses optimistic locking; reviews transaction isolation levels; considers introducing a message queue for state changes; tests for race conditions.

The follow-up you would get

If you implement a locking mechanism, how do you ensure it does not introduce significant performance bottlenecks?

Could you have answered that?
technical API design 2 of 6
You need to design a REST API endpoint to fetch user details with optional filtering by status and role. What design considerations do you take into account, and how do you implement this?
What a strong answer covers

Defines clear and concise URI structure; uses query parameters for optional filters; ensures proper use of HTTP methods and status codes; considers pagination for large datasets; documents the API with examples and expected responses.

The follow-up you would get

You decide to implement pagination. How do you handle sorting on the results?

Could you have answered that?
technical JVM behaviour 3 of 6
Under heavy load, your application shows increased garbage collection pauses, affecting response times. How do you analyse the situation, and what are your initial steps to alleviate it?
What a strong answer covers

Examines GC logs to determine the frequency and duration of pauses; evaluates heap size and memory allocation patterns; considers tuning the garbage collection algorithm; checks for memory leaks or excessive object creation; uses monitoring tools to visualise memory usage over time.

The follow-up you would get

You find that your application is not leaking memory. What else could cause GC pauses?

Could you have answered that?
technical Transaction boundaries 4 of 6
A transaction in your Spring application is expected to commit in under 5 seconds, but it occasionally takes over 30 seconds. How do you troubleshoot this issue, and what metrics would you collect?
What a strong answer covers

Enables transaction logging to identify long-running transactions; checks for database locks or long-running queries during the transaction; evaluates the number of entities being processed in the transaction; assesses the transaction isolation level; considers the impact of cascading operations.

The follow-up you would get

You identify a long-running query within the transaction. What actions do you take?

Could you have answered that?
ownership A disagreement with a team member 5 of 6
Can you recount a time when you disagreed with a team member about a technical choice? What was the outcome?
What a strong answer covers

Describes the context of the disagreement and the specific choice in question; explains the rationale behind their position and the opposing view; discusses how the discussion was approached and resolved; reflects on the final decision and its impact on the project; avoids personal criticism.

The follow-up you would get

What did you learn from this experience?

Could you have answered that?
scenario API versioning 6 of 6
You are asked to support a new feature in your REST API that requires breaking changes to the existing endpoints. How do you approach this while ensuring backward compatibility?
What a strong answer covers

Identifies the need for versioning strategy; discusses using URL path versioning or header-based versioning; considers impact on clients and documentation; plans for deprecation schedule for old versions; ensures thorough testing for both old and new versions.

The follow-up you would get

How do you communicate these changes to the stakeholders and clients affected by the breaking changes?

Could you have answered that?
That is this set.

Load six more — you will get questions you have not seen first.

Give me six more →

Say your answer out loud before revealing. Reading the answer first feels like learning and is not.