Topic Page

SQL and PostgreSQL interview questions and answers.

Backend Java roles almost always touch SQL, and PostgreSQL questions show up often because they expose how well a candidate understands data access, performance, and transactional behavior. This page groups the most important interview themes from that area.

What good answers look like

Strong SQL interview answers balance clarity and trade-offs. You should be able to explain what an index is, but also when indexes hurt write performance. You should know what a JOIN does, but also when a correlated subquery or window function may be a better fit. PostgreSQL-specific questions often go further into MVCC, VACUUM, and planner behavior because these are common sources of real production issues.

This topic cluster is especially valuable for Java backend interviews that combine Spring Boot with Hibernate, JPA, or direct SQL optimization work.

Representative SQL and PostgreSQL interview questions

  1. What are indexes and why are they needed?
  2. How does a B-tree index work?
  3. What is a composite index?
  4. What is the difference between INNER JOIN and LEFT JOIN?
  5. What is a correlated subquery?
  6. What is the difference between WHERE and HAVING?
  7. What do window functions do?
  8. How does MVCC work in PostgreSQL?
  9. What is VACUUM in PostgreSQL?
  10. How do you optimize a slow query?

Related pages