Interview practice

Java Backend Developer

5–8 years · Senior — Java · Spring Boot · REST APIs · JPA / Hibernate · SQL · Microservices

0–2 years 2–5 years 5–8 years 8+ years
ownership A failure you managed 1 of 6
Describe a significant failure in a project you managed and how you addressed it.
What a strong answer covers

Identifies the project and its objectives; specifies the failure point and its impact; discusses the investigation process and root cause analysis; outlines the corrective actions taken; reflects on lessons learned and changes implemented to prevent recurrence.

The follow-up you would get

What warning signs did you ignore beforehand?

Could you have answered that?
technical Transaction Management 2 of 6
You have a service that processes transactions, but occasionally, some transactions are lost during a system crash. How do you investigate and ensure transactional integrity?
What a strong answer covers

Examines the transaction boundary and whether it is defined correctly; checks for proper use of @Transactional annotations; evaluates if the rollback scenarios are appropriately handled; assesses connection handling and transaction log size; considers implementing idempotency for operations.

The follow-up you would get

If the transaction boundary is correct, what other factors could lead to lost transactions?

Could you have answered that?
scenario Data Migration 3 of 6
You need to migrate a large dataset to a new database schema with minimal downtime. What steps do you take to ensure a smooth migration?
What a strong answer covers

Plans a phased migration approach to reduce load; uses shadow reads to compare old and new datasets; implements change data capture for ongoing changes during migration; sets up rollback procedures in case of issues; ensures thorough testing of migration scripts.

The follow-up you would get

If the migration process encounters unexpected performance degradation, how would you adjust your approach?

Could you have answered that?
scenario Concurrency Issues 4 of 6
You discover that two microservices are competing for the same database resources, causing deadlocks. Describe your immediate response and resolution steps.
What a strong answer covers

Identifies the deadlock by reviewing logs and thread states; checks transaction isolation levels and locking mechanisms; reviews service dependencies and data access patterns; proposes redesign or refactoring of resource access; considers implementing retry logic or timeout configurations.

The follow-up you would get

If the deadlocks continue after your changes, what long-term solutions would you explore?

Could you have answered that?
scenario API Versioning 5 of 6
You need to deprecate an old version of your REST API but users are still on it. How do you manage the deprecation process while maintaining service quality?
What a strong answer covers

Communicates deprecation timeline to users through documentation and headers; implements a graceful transition period with both versions running; monitors usage of the old API; provides support and migration guides for users; sets a hard deadline for the removal of the old version.

The follow-up you would get

If users refuse to migrate, how do you balance support for the old version with the need to advance the codebase?

Could you have answered that?
technical Data Access 6 of 6
You notice that a JPA query is taking significantly longer as the data set has grown, resulting in N+1 query problems. How do you diagnose and address this?
What a strong answer covers

Inspects the generated SQL to identify N+1 issues; reviews fetch strategies and considers using JOIN FETCH in queries; evaluates entity relationships for proper lazy/eager loading; applies batch fetching to reduce the number of queries; suggests profiling the database access to pinpoint slow queries.

The follow-up you would get

If changing fetch strategy doesn't help, what other optimisations can be considered?

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.