Ctrl K
Java · Mid-level · System design

A 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?

~10 min by voice

How to approach it

They're checking whether you can run long background tasks reliably: an asynchronous API, a bounded pool, state stored in the database, running across several instances, and behavior under failures, overload and restarts. "I'll put @Async on it" alone isn't enough.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsHow do you organize exception handling in a Spring application: where do you catch exceptions, and when do you use checked versus unchecked exceptions? Mid-levelHow does the @Transactional annotation work in Spring? JuniorWhich Spring bean scopes have you used, and what happens if you inject a prototype bean into a singleton? Mid-levelDesign 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? SeniorA 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-level

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~10 min