programming languages Online Quiz - 70

Covers programming fundamentals including sorting algorithms, data structures, operators, and C/C++ language features, along with Java Hibernate ORM framework concepts including session management, caching, and configuration.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Batch fetching is useful incase of ?

  1. lazy="true"
  2. lazy="false"
  3. lazy="on"
  4. lazy="off"
Question 2 Multiple Choice (Single Answer)

what is the default value in hibernate ?

  1. lazy=false;
  2. lazy=true;
  3. lazy=yes;
  4. lazy=no;
Question 3 Multiple Choice (Single Answer)

HQL is used in ?

  1. session.createQuery();
  2. session.createCriteria();
  3. session.createSQLQuery();
  4. session.lod();
Question 4 Multiple Choice (Single Answer)

What does session.load() return if there is no matching database row ?

  1. NULL
  2. Empty Object
  3. Unrecoverable exception
  4. None of the above
Question 5 Multiple Choice (Single Answer)

Does hibernate require persistent classes to implement Serializable?

  1. Required
  2. Not Required
  3. None of the above
  4. None
Question 6 Multiple Choice (Single Answer)

What does CacheMode do ?

  1. controls how a particular SessionFactory interacts with the Data Base.
  2. controls how a particular SessionFactory interacts with the second-level cache.
  3. controls how a particular session interacts with the second-level cache.
  4. None
Question 7 Multiple Choice (Single Answer)

If instances are not in the session or second-level cache which will give better performance?

  1. Query.list()
  2. Query.iterate()
  3. Both are same
  4. None of the above
Question 8 Multiple Choice (Single Answer)

What does sess.delete() do?

  1. a) remove data from in memory
  2. b) remove from database.
  3. c) remove from sessionFactory
  4. d) None of the above.
Question 9 Multiple Choice (Single Answer)

How can a whole class be mapped as immutable?

  1. By using the mutable="false" attribute in the class mapping.
  2. By using the ismutable="false" attribute in the class mapping.
  3. By using the ismutable="no" attribute in the class mapping
  4. None
Question 10 Multiple Choice (Single Answer)

what does hibernate.hbm2ddl.auto create this means ?

  1. create tables automatically
  2. create session object automatically
  3. create Session Factory object automatically
  4. None
Question 11 Multiple Choice (Single Answer)

Employee emp = session.load(Employee .class);

  1. Yes
  2. No
  3. None
  4. None of the above
Question 12 Multiple Choice (Single Answer)

____ forces hibernate to bypass the setter method and access the instance variable directly while initializing a newly loaded object.

  1. By mapping the property with access="onlyfield" in Hibernate metadata
  2. By mapping the property with access="variable" in Hibernate metadata
  3. By mapping the property with access="field" in Hibernate metadata
  4. none of the above
Question 13 Multiple Choice (Single Answer)

Difference between Emp e = session.load(Emp.class) and Emp e = session.createCriteria(Emp.class) ?

  1. On session close session.load() Emp Object unavailable to access.
  2. On session close session.createCriteria() Emp unavailable to access.
  3. None
  4. a & b
Question 14 Multiple Choice (Single Answer)

Which of the following is true?

  1. 1
  2. 66
  3. .1
  4. -1
  5. All of the above
Question 15 Multiple Choice (Single Answer)

What does 7/9*9 equal (in C and C++)?

  1. 1
  2. 0.08642
  3. 0
  4. 7
Question 16 Multiple Choice (Single Answer)

Which of the following is evaluated first:

  1. &&
  2. ||
  3. !
  4. &&&
Question 17 Multiple Choice (Single Answer)

If you continuously increment a variable, it will become negative?

  1. True
  2. False
  3. Cannot continuously increment a variable
  4. It depends on the variable type
Question 18 Multiple Choice (Single Answer)

Which of the following data structures is on average the fastest for retrieving data:

  1. Binary Tree
  2. Hash Table
  3. Stack
  4. Queue
Question 19 Multiple Choice (Single Answer)

What is the output of the following code: int v() { int m=0; return m++; } int main() { cout<<v(); }

  1. 1
  2. 0
  3. Code cannot compile
  4. Run time error
Question 20 Multiple Choice (Single Answer)

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4

  1. Bubble Sort
  2. Quick Sort
  3. Merge Sort
  4. Radix Sort