Blog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2025 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Spring
Springhard

Spring Data JPA: what is the N+1 problem and how do you reduce it?

Tags
#jpa#hibernate#n-plus-one#performance
Back to categoryPractice quiz

Answer

N+1 is when you load N parent entities and then trigger one extra query per entity (lazy loading). Reduce it with fetch joins, `@EntityGraph`, batching, or redesigning queries to load needed data in fewer round-trips.

Related questions

MongoDB
Text indexes: when would you use them and what’s a limitation?
#mongo#text-index#search
MongoDB
`$lookup`: what does it do and what is a common pitfall?
#mongo#lookup#aggregation
PostgreSQL
Materialized view vs view: what’s the difference?
#postgres#views#materialized-view
Databases
Denormalization: when might you do it and what’s the trade‑off?
#database#denormalization#performance
Databases
What is a covering index (index‑only scan) and why can it be faster?
#database#indexes#covering-index
Cloud
What is a CDN and when should you use it?
#cloud#cdn#performance