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 | ||||||||||||||||||||||||||||
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 | ||||||||||||||||||||||||||||
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 = '
|