Top 30 Hibernate and Spring Data JPA interview questions

Carvia Tech | September 11, 2019 | 2 min read | 258 views


This article is the compilation of important Java interview questions for Hibernate and Spring Data JPA
  • Hibernate vs Spring Data JPA? What is difference?

  • What are inheritance mapping strategies in JPA

  • What are different states of an entity in persistence context?

  • What are dirty read, non-repeatable read and phantom read?

  • What are different Transaction Propagation Levels?

  • What are different types of entity relationships in RDBMS?

  • What is difference between JPA unidirectional OneToOne and ManyToOne?

  • How to prevent lost updates in database transactions using spring data jpa?

  • What is N+1 problem in Hibernate, how will you identify and solve it?

  • How will you implement database table backed job queue using Spring Hibernate?

  • How to implement thread safe table backed global counter in spring hibernate?

  • Difference between getOne and findById in Spring Data JPA?

  • How to configure multiple data sources in Spring Data JPA?

  • How to implement optimistic locking in database using hibernate?

  • Is EntityManagerFactory and EntityManager thread-safe?

  • How to send an email from a transactional service only if the transaction succeeds?

  • How to fetch stream of records from a very big database table?

  • Batch insert data into database table using Spring Data JPA?

  • How to write testcase for Hibernate/Spring Data JPA?

  • How to use Projections to limit the record columns returned by Spring Data JPA query?

  • How to prevent Jackson from serializing the lazy relationship objects?

  • When do you annotate your repository with NoRepositoryBean?

  • How to persist million records into database using Spring Data JPA in an efficient manner?

  • How to execute Repository queries asynchronously?

  • How to upgrade your database from one application version to another?

  • Pros and cons of different ID generation Strategies in Hibernate?

  • Reactive database operations using Postgres and Spring Boot 2

  • Reactive mongodb operations using Spring Boot 2

  • How to use Projections to fetch the limited content from database?

  • How will you implement OneToOne relation using Spring Data JPA

  • How to use Criteria Builder API in Spring Data JPA


Top articles in this category:
  1. Top 50 Multi-threading Java Interview Questions for Investment Bank
  2. Sapient Global Market Java Interview Questions and Coding Exercise
  3. UBS Top 10 Java Interview Questions
  4. BlackRock Top Java Interview Questions: Investment Banking Domain
  5. Cracking core java interviews - question bank
  6. ION Trading Java Interview Questions
  7. Goldman Sachs Java Interview Questions for Senior Developer


Find more on this topic:
Java Interviews image
Java Interviews

Interview - Product Companies, eCommerce Companies, Investment Banking, Healthcare Industry, Service Companies and Startups.

Last updated 1 week ago


Recommended books for interview preparation:

This website uses cookies to ensure you get the best experience on our website. more info