Ctrl K

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?Java · TheoryJuniorWhat is dependency injection in Spring, and what is a bean?Java · TheoryJuniorA method is annotated with @Transactional, but when an error occurs the data in the database isn't rolled back. What causes would you check?Java · TheoryMid-levelHow do you organize exception handling in a Spring application: where do you catch exceptions, and when do you use checked versus unchecked exceptions?Java · TheoryMid-levelWhich Spring bean scopes have you used, and what happens if you inject a prototype bean into a singleton?Java · TheoryMid-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?Java · System designMid-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?Java · TheorySeniorHow does the @Transactional annotation work in Spring? Tell me about situations where a transaction behaves differently from what the developer expects.Java · TheorySeniorHow 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.Java · TheorySeniorDesign 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?Java · System designSeniorYou 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?Java · System designSenior