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 for 'Oracle' - 43 question(s) found - Order By Newest | |||||||||||||
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 | |||||||||||||
Basic and Very Frequently asked. | |||||||||||||
| |||||||||||||
Ans. Polymorphism means the condition of occurring in several different forms. Polymorphism in Java is achieved in two manners 1. Static polymorphism is the polymorphic resolution identified at compile time and is achieved through function overloading whereas 2. Dynamic polymorphism is the polymorphic resolution identified at runtime and is achieved through method overriding. | |||||||||||||
Sample Code for overloading Sample Code for overriding | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  polymorphism  object oriented programming (oops)  oops concepts  oops concepts Asked in 108 Companies Basic   frequent | |||||||||||||
Try 2 Question(s) Test | |||||||||||||
Frequently asked in Infosys India | |||||||||||||
| |||||||||||||
Ans. String pool (String intern pool) is a special storage area in Java heap. When a string is created and if the string already exists in the pool, the reference of the existing string will be returned, instead of creating a new object and returning its reference. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  java   oops   string   string class   string pool   heap memory Asked in 31 Companies intermediate   frequent | |||||||||||||
Try 2 Question(s) Test | |||||||||||||
Very frequently asked. Favorite question in Walk in Drive of many Indian service companies. | |||||||||||||
| |||||||||||||
Ans. Its a method which cannot be overridden. Compiler throws an error if we try to override a method which has been declared final in the parent class. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  java   oops   final   final method Asked in 30 Companies basic   frequent | |||||||||||||
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 | |||||||||||||
Frequently asked to fresh graduates. | |||||||||||||
| |||||||||||||
Ans. ACID stands for Atomicity, Consistency, Isolation, Durability is a set of properties of database transactions. Atomicity means all or nothing. i.e parts of a transaction shouldn't commit if any one of them fails. Either the whole transaction should succeed or it should be complete rollback. Consistency means that any transaction should lead database from one stabe state to another. Isolation means that the execution of transaction results in a system state that would be obtained if transactions were executed serially. Durability means that when a transaction is committed it forms the permanent state of database. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  database  acid Asked in 7 Companies Intermediate | |||||||||||||
Try 1 Question(s) Test | |||||||||||||
| |||||||||||||
Ans. Yes.we cannot access them directly but we can access them using object reference.Static methods belong to a class and not objects whereas non static members are tied to an instance. Accessing instance variables without the instance handler would mean an ambiguity regarding which instance the method is referring to and hence its prohibited. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  java   oops   static   static methods   java keywords Asked in 1 Companies | |||||||||||||
Frequently asked in high end product companies. Frequently asked in Deloitte. | |||||||||||||
| |||||||||||||
Ans. https://medium.com/javarevisited/internal-working-of-hashmap-in-java-97aeac3c7beb#:~:text=HashMap%20internally%20uses%20HashTable%20implementation,the%20entries%20into%20the%20map. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  hashmap  collections  hashmap internal implementation Asked in 20 Companies expert   frequent | |||||||||||||
| |||||||||||||
Ans. Vectors are synchronized whereas Array lists are not. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  java   basic interview question   vector   arraylist   collections   synchronization   vector vs arraylist Asked in 35 Companies basic   frequent | |||||||||||||
Very frequently asked in phone and walk in interviews. | |||||||||||||
| |||||||||||||
Ans. An interface without any method declaration is called as marker interface. there are 3 in-built interfaces in JVM i.e. serializable, clonable, remote | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  java   oops   interfaces   marker interface   serializable   clonable Asked in 21 Companies intermediate   frequent | |||||||||||||
Try 1 Question(s) Test | |||||||||||||
Very frequently asked. Usually asked with questions related to String. Frequently asked at CTS / Cognizant | |||||||||||||
| |||||||||||||
Ans. Object that can't be changed after instantiation. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  java   oops   immutable  immutability Asked in 27 Companies basic   frequent | |||||||||||||
Try 2 Question(s) Test | |||||||||||||
| |||||||||||||
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. 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 | |||||||||||||
| |||||||||||||
Ans. A trigger is a special kind of stored procedure that automatically gets executed upon an event in the database server. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  database   trigger Asked in 10 Companies basic   frequent | |||||||||||||
| |||||||||||||
Ans. The external tables feature is a complement to existing SQL Loader functionality. It enables to access data in external sources as if it were in a table in the database. We have used it few times for replicating tables across different database systems. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  external table oracle Asked in 1 Companies   rare | |||||||||||||
| |||||||||||||
Ans. When a Table Join itself , it's a Self Join. For example - we like to know the pair of department names where first dept has lesser employees than the later. Select D1.name , D2.name from Dept D1, Dept D2 where D1.employee_count < D2.employee_count | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  sql  joins  self join  self-join  Pair of employee names with first having lesser salary than later  Pair of department names where first dept has lesser employees than the later Asked in 26 Companies basic   frequent | |||||||||||||
| |||||||||||||
Ans. Earlier any class implementing an interface was supposed to implement all methods declared in an interface. There was no place for optionally implementing all or subset of methods.Though we have abstract classes wherein we could have provided such a mechanism by declaring some methods as abstract while providing definition for some. But as Abstract classes have a body and are comparatively heavier than interfaces and interfaces associate closely to the concept of providing interfacing than abstract classes, Java might have though of providing optional implementation for default methods. This way same interface can be reused in variety of ways rather than making copies of an interface to suit different needs. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  java 8   java8  interface default methods  default methods Asked in 6 Companies | |||||||||||||
| |||||||||||||
Ans. https://en.wikipedia.org/wiki/Database_normalization | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  normalization  database Asked in 35 Companies intermediate   frequent | |||||||||||||
| |||||||||||||
Ans. Transient variables are variable that cannot be serialized. | |||||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||||
Like Discuss Correct / Improve  java   serialization   transient Asked in 15 Companies intermediate   rare | |||||||||||||
| |||||||||||||
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 | |||||||||||||
| |||||||||||||
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 = '
|