System Programming and Hibernate ORM

Advanced programming quiz covering Unix/Linux system programming (IPC, threads, sockets, file operations) and Java Hibernate ORM framework concepts

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

6.) How do I get my program to act like a daemon?

  1. a) Run with root user
  2. b) Run with &
  3. c) Run with root user using &
  4. d) None
Question 2 Multiple Choice (Single Answer)

Does hibernate require persistent classes to implement Serializable?

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

What does CacheMode do ?

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

7.) Why do processes never decrease in size?

  1. a) They never releases the memory utilized
  2. b) They release the memory but kernel does not use them
  3. c) Since they are running
  4. d) It’s a false statement
Question 5 Multiple Choice (Single Answer)

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

  1. a) Query.list()
  2. b) Query.iterate()
  3. c) Both are same
  4. d) None of the above
Question 6 Multiple Choice (Single Answer)

8.) What is the difference between select() & poll()?

  1. a) select() and poll() have no differences
  2. b) poll() is event driven while select() is not
  3. c) select() is event driven while poll() is not
  4. d) None
Question 7 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 8 Multiple Choice (Single Answer)

9.) How do I `lock' a file?

  1. a) Use filelock()
  2. b) use lockfile()
  3. c) Use lockfd()
  4. d) use fcntl()
Question 9 Multiple Choice (Single Answer)

How can a whole class be mapped as immutable?

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

10.) What is a NFS?

  1. a) National File System
  2. b) Network Flashmemory System
  3. c) Network File System
  4. d) Network Fault System
Question 11 Multiple Choice (Single Answer)

what does hibernate.hbm2ddl.auto create this means ?

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

11.) How can I tell how much memory my system has?

  1. a) Use getmemory()
  2. b) Use sysctl()
  3. c) Use freemem()
  4. d) Use malloc()
Question 13 Multiple Choice (Single Answer)

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

  1. Yes
  2. b) No
  3. Cant say
  4. Both
Question 14 Multiple Choice (Single Answer)

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

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

11.) How can I tell how much memory my system has?

  1. a) Use getmemory()
  2. b) Use sysctl()
  3. c) Use freemem()
  4. d) Use malloc()
Question 16 Multiple Choice (Single Answer)

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

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

12.) What is a socket

  1. a) A port to connect printer
  2. b) A port to connect keyboard
  3. c) An abstraction to pass data across processes
  4. d) A hardware device
Question 18 Multiple Choice (Single Answer)

13.) What is a message queue?

  1. a) A printer queue
  2. b) An IPC mechanism with destructive execute
  3. c) An IPC mechanism with destructive write
  4. d) An IPC mechanism with destructive read
Question 19 Multiple Choice (Single Answer)

14.) What is a pthred

  1. a) A printer thread
  2. b) A POSIX standard thread to support multi-tasking
  3. c) A POSIX standard thread to support multi-threading
  4. d) A POSIX standard thread to support kernel debugging
Question 20 Multiple Choice (Single Answer)

15.) If open() is used to open a non-existent file in read-only mode what will happen

  1. a) Creates File
  2. b) Does nothing
  3. c) Return error
  4. d) Not allowed.