Interview questions on Database + Hibernate
1 min readFeb 18, 2023
- How do you prevent SQL injection attacks?
- What is the difference between Non-Repeatable Read and Phantom Read? — click here
- What is difference between WHERE and HAVING clause?
- What are transactions? What is ACID?
- Is Hibernate using pessimistic or optimistic locking?
- What is default Isolation level in MYSQL ? Ans- The default isolation level for
InnoDB
isREPEATABLE READ
( Mysql 8 version) - How to properly handle two threads updating the same row in a database ? — click here
- Difference between truncate, delete and drop clause in SQL?
- What are window functions? how they work?
- What is indexing? Types of indexing?
- How does the query engine execute the query?
- Types of execution Engine ? — click here
- Pessimistic vs Optimistic Locking?
- What is 2PC ?
- What are Transaction Isolation levels ?- click here
- When is it better to use plain SQL instead of ORM?
- Difference between sorted and ordered collection?
- How second level cache works?
- What are the Anomalies in DBMS? — click here
- What is difference between save() and persist()?
- What is difference between Hibernate and MyBatis?
- What is N+1 error in Hibernate?
- What are the two types of Locking in Hibernate?
- What are different type of Caching in Hibernate and how to enable them in your application?
- How to have composite Key in a class in Hibernate?
- Difference between save() vs saveOrUpdate(), get() vs load(), save() vs persist(), merge() vs update()?
- Different type of Mapping in Hibernate and how to enable them?
- What are the different types of persistent Entity?
- What is Criterion query in hibernate?