Hibernate ORM & Unix System Programming Quiz

Test your knowledge of Java Hibernate framework concepts and Unix/C system programming including caching, session management, process control, and system calls.

20 Questions Published

Questions

Question 1 True/False

The following will compile with no errors float abc = 2;

  1. True
  2. False
Question 2 Multiple Choice (Single Answer)

1.) Difference between fork() & vfork()

  1. a) vforlk() allows more one child process to be created simaltaneously whereas for() allows only one
  2. b) vfork() retains same PID for child & parent known as virtual PID
  3. c) vfork() suspends the parent process until child process exits
  4. d) fork() & vfork() are same
Question 3 Multiple Choice (Single Answer)

1.) Difference between fork() & vfork()

  1. a) vforlk() allows more one child process to be created simaltaneously whereas for() allows only one
  2. b) vfork() retains same PID for child & parent known as virtual PID
  3. c) vfork() suspends the parent process until child process exits
  4. d) fork() & vfork() are same
Question 4 Multiple Choice (Single Answer)

2.) How can I get/set an environment variable from a program?

  1. a) getenv(), setenv()
  2. b) getenv(), putenv()
  3. c) readenv(), writeenv()
  4. d) You cannot environmement variables inside a program
Question 5 Multiple Choice (Single Answer)

3.) How can I sleep for less than a second?

  1. a) sleep(1/10)
  2. b) Not possible
  3. c) usleep()
  4. d) ssleep()
Question 6 Multiple Choice (Single Answer)

4.) How can a parent and child process communicate?

  1. a) Using open()
  2. b) Using popen()
  3. c) Using fork()
  4. d) Using exec()
Question 7 Multiple Choice (Single Answer)
  1. Does hibernate allow mixing table-per-class hierarchy and table-per-subclass strategies?
  1. a) Yes
  2. b) No
  3. c) can't say
  4. d) None of the above
Question 8 Multiple Choice (Single Answer)

Which statement is correct ?

  1. a) session.contains() method to determine if an instance belongs to the session cache.
  2. b) session.contains() method to determine if an instance belongs to the data base .
  3. c) Both are correct
  4. d) none of the above
Question 9 Multiple Choice (Single Answer)

5.) How do I get rid of zombie processes?

  1. a) Use popen() & pclose()
  2. b) Use wait()
  3. c) Use ps()
  4. d) None
Question 10 Multiple Choice (Single Answer)

What does session.createQuery("Query").scroll() return ?

  1. a) ListResultSet
  2. b) ResultSet
  3. c) ScrollableResultSet
  4. d) ScrollableResult
Question 11 Multiple Choice (Single Answer)

How can the mapping files be configured in Hibernate?

  1. a) Mapping files can be added to Configuration in the application code
  2. b) They can be configured in hibernate.cfg.xml using the <mapping> elements
  3. c) both a and b
  4. d) none of the above
Question 12 Multiple Choice (Single Answer)

SessionFactory represent which level of cache ?

  1. a) 2nd
  2. b) Ist
  3. c) 3rd
  4. d) 4th
Question 13 Multiple Choice (Single Answer)

SessionFactory represent which level of cache ?

  1. a) 2nd
  2. b) Ist
  3. c) 3rd
  4. d) 4th
Question 14 Multiple Choice (Single Answer)

hibernate.cache.use_query_cache setting true enable cache regions ?

  1. a) StandardQueryCache and UpdateTimestampsCache
  2. b) StandardQueryCache
  3. c) QueryCache
  4. d) QueryCache and TimestampsCache
Question 15 Multiple Choice (Single Answer)

hibernate.cache.use_query_cache setting true enable cache regions ?

  1. a) StandardQueryCache and UpdateTimestampsCache
  2. b) StandardQueryCache
  3. c) QueryCache
  4. d) QueryCache and TimestampsCache
Question 16 Multiple Choice (Single Answer)

batch fetching is useful incase of ?

  1. a) lazy="true"
  2. b) lazy="false"
  3. c) lazy="on"
  4. d) lazy="off"
Question 17 Multiple Choice (Single Answer)

batch fetching is useful incase of ?

  1. a) lazy="true"
  2. b) lazy="false"
  3. c) lazy="on"
  4. d) lazy="off"
Question 18 Multiple Choice (Single Answer)

what is the default value in hibernate ?

  1. a) lazy=false;
  2. b) lazy=true;
  3. c) lazy=yes;
  4. d) lazy=no;
Question 19 Multiple Choice (Single Answer)

HQL is used in ?

  1. a) session.createQuery();
  2. b) session.createCriteria();
  3. c) session.createSQLQuery();
  4. d) session.lod();
Question 20 Multiple Choice (Single Answer)

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

  1. a) NULL
  2. b) Empty Object
  3. c) unrecoverable exception
  4. d) None of the above