What is the N+1 problem in Hibernate, how do you detect it, and what ways do you have of solving it? What are the trade-offs of each approach?
~4 min by voice
How to approach it
This checks whether the candidate understands the mechanics of lazy loading in Hibernate, whether they can find N+1 systematically rather than by the feeling that "the page is slow", and most importantly whether they see the trade-offs of each solution: fetch join, batch fetching, DTO projections, EAGER.
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.