Hibernate ORM and Unix/Linux Programming Quiz

Covers Hibernate ORM framework concepts, Java persistence, and Unix/Linux system programming including file management, process signals, and system utilities

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

16.) To delete all the trailing spaces of each line of file test1

  1. a) sed 's/[ ][^ ]*$//' test2
  2. b) sed 's/[ ][ ]*$//' test2
  3. c) sed 's/[ ][ ]*$/' test2
  4. d) sed 's/[ ][ $]*$//' test2
Question 2 Multiple Choice (Single Answer)

17.) How to duplicate file descriptors?

  1. a) duplicate()
  2. b) dup()
  3. c) cp()
  4. d) mknod()
Question 3 Multiple Choice (Single Answer)

18.) What is the difference between at & cron?

  1. a) Both are Unix scheduling utilities
  2. b) at is restricted one and crontab is not restricted
  3. c) No difference
  4. d) at takes input from user while cron takes from a confiuration file
Question 4 Multiple Choice (Single Answer)

19.) How to remove a queued file from the printer queue?

  1. a) lpqrm
  2. b) lprm
  3. c) jobs -r
  4. d) lpc -rm
Question 5 Multiple Choice (Single Answer)

20.) If inet service is restarted, all the open sockets gets closed

  1. a) True
  2. b) False
  3. c)
  4. d)
Question 6 Multiple Choice (Single Answer)

21.) The difference between telnet & rsh?

  1. a) telnet works only with terminals where rsh works for all
  2. b) telnet is unix product while rsh is a TCP product
  3. c) telnet uses byte protocol while rsh uses stream protocol
  4. d) No difference. They can be used interchangably
Question 7 Multiple Choice (Single Answer)

What does session.evict() method do ?

  1. a) remove the object and its collections from the first level cache
  2. b) remove the object and its collections from the second level cache
  3. c) remove the object and its collections from the data base
  4. d) None of the above
Question 8 Multiple Choice (Single Answer)

22.) Unix shell scripting does not support floating points directly

  1. a) True
  2. b) False
  3. c)
  4. d)
Question 9 Multiple Choice (Single Answer)

Which is simplest code snippet you will add in the below main function to set the name attribute of 50th in the ItemList to “Done”? import java.util.ArrayList; import java.util.List; class Item { public int code; public String name; public Item(String name) { this.name = name; } } public class Main { public static void main(String args[]) { List itemList = new ArrayList(); for (int i = 0; i < 50; i++) { Item im = new Item("Test"); itemList.add(im); } //Code to change name of the 50th object to “Done” } }

  1. im.name = "Done";
  2. Item otherObject = new Item(“Done”); itemList.set(49, otherObject);
  3. ((Item)itemList.get(49)).name = “Done”;
  4. None of above is correct as they are not changing 50th element.
Question 10 Multiple Choice (Single Answer)

23.) Is it possible to process return value of system()?

  1. a) Yes
  2. b) No
  3. c)
  4. d)
Question 11 Multiple Choice (Single Answer)

Is the Session threadsafe in Hibernate ?

  1. a) TRUE
  2. b) FALSE
  3. c) no matter
  4. d) none of the above
Question 12 Multiple Choice (Single Answer)

24.) lpc command is used to

  1. a) Add printer and queues
  2. b) Add modem & flash drive
  3. c) Add printer alone
  4. d) Invalid command
Question 13 Multiple Choice (Single Answer)

How can you make a property be read from the database but not modified in anyway

  1. a) By using the insert="false" and update="false" attributes.
  2. b) By using the isinsert="false" and isupdate="false" attributes.
  3. c) By using the isinsert="no" and isupdate="no" attributes
  4. d) None
Question 14 Multiple Choice (Single Answer)

25.) How to send signals to other processes?

  1. a) Use sigsend()
  2. b) use kill()
  3. c) use signal()
  4. d) Only init can send signals
Question 15 Multiple Choice (Single Answer)

Which statement is correct ?

  1. a) A Session will not obtain a JDBC Connection (or a Datasource) unless it is needed
  2. b) A Session will obtain a JDBC Connection (or a Datasource) on object create
  3. c) A Session has no relation with JDBC Connection (or a Datasource)
  4. d) none of the above
Question 16 Multiple Choice (Single Answer)

How to enable query cache in hibernate

  1. a) hibernate.cache.query_cache true
  2. b) hibernate.cache.use_query_cache true
  3. c) hibernate.cache.query_cache yes
  4. d) none
Question 17 Multiple Choice (Single Answer)

If you are not certain that a matching row exists in the database then which method is the best ?

  1. a) Session.load();
  2. b) Session.get();
  3. c) Session.fetch();
  4. d) None of the above
Question 18 Multiple Choice (Single Answer)

Which statement is correct?

  1. a) bag has index column
  2. b) bag permits duplicate element values
  3. c) bag does not permits duplicate element values
  4. d) None
Question 19 Multiple Choice (Single Answer)

It is possible to re-load an object and all its collections at any time, using the xxxx() method. This is useful when database triggers are used to initialize some of the properties of the object.What is the xxxx() method ?

  1. a) refresh();
  2. b) flush();
  3. c) fetch();
  4. d) load()
Question 20 Multiple Choice (Single Answer)

What is the root level element in a hibernate mapping file?

  1. a) <session-factory>
  2. b) <hibernate>
  3. c) <hibernate-configuration>
  4. d) None