Question library
Questions from real interviews. Drill any of them by voice in a couple of minutes, with an interviewer, a score and feedback.
How does the @Transactional annotation work in Spring?JuniorWhat is dependency injection in Spring, and what is a bean?JuniorA method is annotated with @Transactional, but when an error occurs the data in the database isn't rolled back. What causes would you check?Mid-levelHow do you organize exception handling in a Spring application: where do you catch exceptions, and when do you use checked versus unchecked exceptions?Mid-levelWhich Spring bean scopes have you used, and what happens if you inject a prototype bean into a singleton?Mid-levelA Spring Boot service needs to accept report generation tasks, each of which takes several minutes. How would you organize running them inside the Java application?Mid-levelHow do you build a testing strategy for a Spring Boot service: what do you verify with unit tests using Mockito, what with integration tests, and why?SeniorHow does the @Transactional annotation work in Spring? Tell me about situations where a transaction behaves differently from what the developer expects.SeniorHow does the bean lifecycle work in Spring, and how does dependency injection work? Tell me about design problems you've run into that were related to DI.SeniorDesign caching for a high-load Spring Boot application running as several instances. How would you choose between a local and a distributed cache, and how would you handle invalidation?SeniorYou have a Spring Boot monolith that a team of thirty people has been developing for five years, and it's started slowing development down. How would you decide whether to split it into services or modularize it internally, and how would you carry out the changes?Senior