Hibernate Questions on Important Differences for Self Assessment

These are some of the commonly asked questions to check if you know the differences between important concepts or APIs in Hibernate. This may contain beginner to advanced level questions.


  1. Differentiate between entities and value types in Hibernate.

  2. What is the difference between save() and persist() methods in Hibernate?

  3. What is the difference between get and load methods in hibernate?

Different Ways to Configure in Hibernate 4.3

Before working with hibernate in your code, you will need to configure Hibernate with information regarding your database such as host, port, credentials etc. You also need to create mappings that tell hibernate how to map the state of a Java entity to the columns of its corresponding table.

We can configure various hibernate features either through annotations or through xml files (hbm files). Preferred approach currently is annotations.


You can configure Hibernate mainly in three ways:

Hibernate Essentials Questions for Self Assessment

This is a list of basic questions from Hibernate which you can use to check your understanding or even prepare for interviews. You may use the parent chapter, other chapters or hibernate or the forum to discuss more on these questions.


  1. What is a framework?

  2. What do you mean by CRUD?

  3. What is Hibernate? What are the advantages of using Hibernate?

  4. What is Java Persistence API (JPA)?

[Downloads] Sample questions for OCA Java SE 7 Programmer I Certification Preparation

This page contains 500+ sample exam questions for OCA Java SE 7 Programmer I certification 1ZO-803 exam to test your knowledge on core Java. Materials are free, but to avoid misuse of materials, we have encrypted the downloads. Please check note below for getting password for the questions and also for getting the answers and explanations.


Coding Contest: Program to Read Index from a Pdf

You need to create a program that takes any PDF ebook as an input , read its index (table of contents in the begenning) then and print it into an html file with bulleted points and proper indentation. 

You may ask any doubt as a comment below. Don't make assumptions without asking.


Important Rules

  1. The decision on the winner will be made by team and will be final.

[Problems] Summary of Problems on Arrays

  1. Find all pairs of integers within an array that sum to a specified value:

    • Approach 1: Using hash table (more time efficient)

    • Approach 2: Through sorting (more space efficient)

  2. Given an M x N matrix, if an element is 0, its entire row and column in the matrix should be set to 0.

  3. You are given a 2-Dimensional array (matrix) and a scale factor. You need to write a method to scale the 2D array according to the scale factor.

[Problems] Summary of Problems on Sorting and Searching

  1. Merge two sorted arrays A and B in sorted order. A has enough locations in the end to hold the elements of B.

    • No extra buffer should be used.

    • Every element should be shifted from its current position in A, at most 1 time.

    • Hint:

      • Start filling from the end of A.

  2. Sort an array of Strings. All anagrams should be next to each other.

    • Hint:

      • Approach 1: Modify the comparator to indicate that two anagrams are equal, and then sort.

[Problems] Summary of Problems Based on Mathematics and Probability

  1. Write methods to implement the multiply, substract and divide operations for integers, using only the add operator.

    • Hint:

      • a + b => a + negate(b)

      • a * b => add b a times

      • x = a / b => a = bx.

  2. Find the kth number such that the only prime factors are 3,5 and 7

[Algorithm+Implementation] Sieve of Eratosthenes Algorithm for Finding all Prime Numbers Up To Any Given Limit

In mathematics, the sieve of Eratosthenes is an algorithm for finding all prime numbers up to any given limit.

It does so by iteratively marking as composite (i.e., not prime) the multiples of each prime, starting with the multiples of 2.

It works on the principle that all non-prime numbers are divisible by a prime number.

[Problems] Summary of Problems Based on Sequences

Problems related to sequence generation and finding if an element fits in a sequence.



  1. Generate the below sequence with n elements.

    • 1, 10, 11, 100, 110, 111, 1000.

    • Note:

      • Every element in the sequence is a series of 1 or more 1's followed by zero or more 0's.

        • For example 101 is an invalid element and does not belong to the sequence, but 1, 10, 11, 100, 110, 111, 1000 etc. belong to the sequence.


Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within!!!