Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||||||||||||||||||||||||||
Interview Questions and Answers - Order By Rating | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. It should be followed by either catch or finally block. | ||||||||||||||||||||||||||||
Sample Code for Retry in case of exception | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  java   exceptions   exception handling   try   catch   finally  Oracle OCA Test Asked in 3 Companies basic   frequent | ||||||||||||||||||||||||||||
Try 1 Question(s) Test | ||||||||||||||||||||||||||||
Frequently asked in CTS ( Based on 2 feedback ) | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. Comparable interface is used for single sequence sorting i.e.sorting the objects based on single data member where as comparator interface is used to sort the object based on multiple data members. | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  java   java.util   comparable   comparator   collections Asked in 23 Companies basic   frequent | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. The finally keyword is used to create a block of code that follows a try block. A finally block of code always executes, whether or not an exception has occurred. | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  java   exceptions   exception handling   try   finally   basic interview question Asked in 1 Companies | ||||||||||||||||||||||||||||
Try 1 Question(s) Test | ||||||||||||||||||||||||||||
Advanced level question frequently asked in US based companies. Recently asked in EMC and Intuit. | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. Simplest implementation we can have is a List wherein we can place ordered words and hence can perform Binary Search. Other implementation with better search performance is to use HashMap with key as first character of the word and value as a LinkedList. Further level up, we can have linked Hashmaps like , hashmap { a ( key ) -> hashmap (key-aa , value (hashmap(key-aaa,value) b ( key ) -> hashmap (key-ba , value (hashmap(key-baa,value) .................................................................................... z( key ) -> hashmap (key-za , value (hashmap(key-zaa,value) } upto n levels ( where n is the average size of the word in dictionary. | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  java   collections   hashmap   binary search   search algorithm   advanced   architecture   data structure Asked in 6 Companies   frequent | ||||||||||||||||||||||||||||
Try 1 Question(s) Test | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. import static java.lang.System.*; | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  java   static import   generics   import   OCJP   SCJP   Oracle certified java developer Asked in 1 Companies | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. ConcurrentHashMap is a hashMap that allows concurrent modifications from multiple threads as there can be multiple locks on the same hashmap. | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  java   collections   hashmap   map   concurrenthashmap   concurrenthashmap  concurrency   general electric   ge Asked in 32 Companies   rare | ||||||||||||||||||||||||||||
Very frequently asked if being interviewed for hibernate. Frequently asked in Tata Consultancy (TCS) and Overstock.com | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. If id doesnt exist in the DB load throws an exception whereas get returns null in that case.get makes the call to DB immediately whereas load makes the call to proxy. | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  hibernate Asked in 16 Companies basic   frequent | ||||||||||||||||||||||||||||
Frequently asked question in companies using Hibernate. | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. It's a feature to lazily initialize dependencies , relationship and associations from the Database. Any related references marked as @OneToMany or @ManyToMany are loaded lazily i.e when they are accessed and not when the parent is loaded. | ||||||||||||||||||||||||||||
Sample Code for Lazy Initialization | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  hibernate   lazy loading hibernate   lazy initialization hibernate   architecture Asked in 77 Companies Basic   frequent | ||||||||||||||||||||||||||||
Try 2 Question(s) Test | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. First will check if the table or view actually exist in the DB If it does , Will make sure to see that the application has rights on the schema that holds the respective Table. Will then make sure that we have prefixed the schema with the table name while accessing it. Will then make sure that its not DB Cache that's causing it as the table DDL might have been created recently. | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  sql   database   oracle   technical lead | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. In case we specify them explicitly we can have control over constraint name as otherwise they will be system generated. It provides an ease in case we plan to drop the constraint in future. | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  sql   database   oracle | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. alter table table_name DISABLE constraint constraint_name; | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  sql   database   oracle | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. Yes, but the respective key in the foreign table should be declared Unique. | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  sql   database   oracle Asked in 2 Companies | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. We need to create a sequence. | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  sql   database   oracle | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. NOT NULL | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  sql   oracle   database   ddl   constraint   table creation | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. DESC | ||||||||||||||||||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | ||||||||||||||||||||||||||||
Like Discuss Correct / Improve  sql   database   oracle | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
Ans. SELECT * FROM user_constraints WHERE table_name = '
|