Published:
Last updated:

Hibernate

Authors
Time yourself:
Your progress:

00:30:00

0%

Filter by difficulty

46 of 46 questions shown

Basics and Introduction

1. What is Hibernate, and why is it used?

Junior
Flag important question
Mark as complete

2. What are the advantages of using Hibernate over JDBC?

Junior
Flag important question
Mark as complete

3. What is the Hibernate architecture?

Mid-level
Flag important question
Mark as complete

4. What is the difference between Hibernate and Spring JPA?

Mid-level
Flag important question
Mark as complete

Configuration

5. How do you configure Hibernate with XML and annotations?

Mid-level
Flag important question
Mark as complete

Free preview complete

You’ve reached the end of the free preview

Get every remaining question and complete answer, plus progress tracking across the full Interview Question Library.

  • 41 more questions and complete answers in this topic
  • Full access to every interview topic
  • Progress tracking and question flags
  • New questions and improvements during your subscription

Full access from

$12/month

No long-term commitment. Cancel whenever you want.

6. What is the purpose of hibernate.cfg.xml?

JuniorPaid Question

7. How do you set up Hibernate with a Java configuration (without XML)?

Mid-levelPaid Question

8. What is the role of the SessionFactory?

JuniorPaid Question

Mapping

9. What is ORM (Object-Relational Mapping)?

JuniorPaid Question

10. How do you map a Java class to a database table?

Mid-levelPaid Question

11. What is the difference between @Entity and @Table annotations?

Mid-levelPaid Question

12. How do you map relationships (one-to-one, one-to-many, many-to-many)?

Mid-levelPaid Question

13. What are the advantages of lazy loading in mapping?

JuniorPaid Question

14. How do you perform create, read, update, and delete operations in Hibernate?

Mid-levelPaid Question

15. What's the difference between transient and detached entities?

Mid-levelPaid Question

16. How do you use save() vs persist()?

Mid-levelPaid Question

17. What is the difference between update() and merge()?

Mid-levelPaid Question

18. How does Hibernate handle primary key generation?

Mid-levelPaid Question

Caching

19. What is caching in Hibernate, and why is it important?

JuniorPaid Question

20. What is the difference between first-level and second-level caching?

Mid-levelPaid Question

21. What are the popular caching providers in Hibernate?

JuniorPaid Question

Querying

22. What is HQL (Hibernate Query Language)?

JuniorPaid Question

23. How is HQL different from SQL?

Mid-levelPaid Question

24. What is the Criteria API in Hibernate?

JuniorPaid Question

25. How do you use native SQL queries in Hibernate?

Mid-levelPaid Question

Transactions and Concurrency

26. How does Hibernate manage transactions?

Mid-levelPaid Question

27. What is the difference between commit() and flush()?

Mid-levelPaid Question

28. What are the use cases for optimistic locking and pessimistic locking?

Mid-levelPaid Question

29. What are the isolation levels in Hibernate?

Mid-levelPaid Question

Performance Tuning

30. How do you optimize Hibernate queries?

SeniorPaid Question

31. How does lazy and eager loading impact performance?

Mid-levelPaid Question

32. How do you analyze the SQL generated by Hibernate?

Mid-levelPaid Question

33. What are batch processing and its benefits in Hibernate?

Mid-levelPaid Question

Advanced Features

34. What are Hibernate interceptors and event listeners?

Mid-levelPaid Question

35. How do you implement a custom ID generator in Hibernate?

Mid-levelPaid Question

36. What is Hibernate’s dirty checking mechanism?

Mid-levelPaid Question

37. What is the difference between get() and load()?

Mid-levelPaid Question

Integrations

38. How do you integrate Hibernate with Spring?

Mid-levelPaid Question

39. What are Hibernate's capabilities in a microservices architecture?

Mid-levelPaid Question

40. How do you use Hibernate with JPA?

Mid-levelPaid Question

Error Handling and Debugging

41. What are common exceptions in Hibernate?

JuniorPaid Question

42. How do you debug lazy initialization exceptions?

Mid-levelPaid Question

43. How do you resolve issues related to n+1 queries in Hibernate?

Mid-levelPaid Question

Testing

44. How do you test Hibernate applications?

Mid-levelPaid Question

45. What are in-memory databases, and how are they used in Hibernate testing?

Mid-levelPaid Question

46. How do you mock Hibernate Session objects?

Mid-levelPaid Question