Interview Questions and Answers for 'Oop' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

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.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Newest

   next 30
 Q131. Which of the following is not a phase of Reducer ?

a. Map
b. Reduce
c. Shuffle
d. Sort
Ans. Map

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   map reduce


 Q132. How many instances of Job tracker can run on Hadoop cluster ?
a. 1
b. 2
c. 3
d. 4
Ans. 1

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   hadoop cluster


 Q133. Which of the following is not the Dameon process that runs on a hadoop cluster ?

a. JobTracker
b. DataNode
c. TaskTracker
d. TaskNode
Ans. TaskNode

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   hadoop cluster


 Q134. What is an instance variable?

a. An instance or object of an class
b. The field of an object
c. Any variable of a class
d. None of the above
Ans. The field of an object

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   oops   oop   instance variable   variables


 Q135. Which of the following do you think is the primary reason you would never use a static class even the application doesn't need multiple requests or threads ?

a. Serialization
b. Runtime Polymorphism
c. Lazy Loading
d. Memory
Ans. Runtime Polymorphism

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     static class   static vs singleton   java   oops   objects  Runtime Polymorphism


 Q136. What is a Sequence File?

a. A Sequence File contains a binary encoding of an arbitrary number of homogeneous writable objects.
b. A Sequence File contains a binary encoding of an arbitrary number key-value pairs. Each key must be the same type. Each value must be of same type.
c. A Sequence File contains a binary encoding of an arbitrary number of heterogeneous writeable objects.
d. A Sequence File contains a binary encoding of an arbitrary number of Writable Comparable objects, in sorted order.
Ans. A Sequence File contains a binary encoding of an arbitrary number key-value pairs. Each key must be the same type. Each value must be of same type.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   bigdata   big data


 Q137. What is the input to the Reduce function ?

a. One Key and One Value
b. Multiple Keys and Multiple associated Values
c. Multiple Keys and One associated values with each
d. One key and associated values.
Ans. One key and associated values.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   bigdata   big data   map-reduce   map reduce   reduce function


 Q138. Which of the following is the implementation language for Map Reduce Framework ?

a. Big Data
b. Hadoop
c. Java
d. C++
Ans. Java

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   bigdata   big data   map-reduce   map reduce framework


 Q139. Will a for loop like following throw a compilation error ? for(;;);
Ans. No. It will result in infinite loop

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     loop  for loop  java


Must know at all levels. Among Top 10 frequently asked questions in Java. Very frequently asked to fresh graduates or less experienced professionals.
  Q140. What is Inheritance ?Core Java
Ans. Its a facility for code reuse and independent extension wherein a derived class inherits the properties of parent class.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     inheritance  object oriented programming (oops)  oops concepts  oops concepts  java concepts  code reuse  code re-use   classes  derived classes     Asked in 14 Companies      basic        frequent


 Q141. How is static and dynamic polymorphism achieved in Java ?Core Java
Ans. Static polymorphism is the polymorphic resolution identified at compile time and is achieved through function overloading whereas dynamic polymorphism is the polymorphic resolution identified at runtime and is achieved through method overriding.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     static polymorphism  object oriented programming (oops)  oops concepts   dynamic polymorphism  object oriented programming (oops)  oops concepts   polymorphism  object oriented programming (oops)  oops concepts   overloading   overriding   broadridg     Asked in 1 Companies      basic        frequent


  Q142. How is multiple inheritance implemented in Java ?Core Java
Ans. There was no multiple inheritance in java before version 8 as implementing multiple interfaces cannot be termed as inheritance.

With Java 8 , came the concept of default methods wherein the class implementing the interface carries the default implementation from the interface and hence facilitating multiple inheritance.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     multiple inheritance  object oriented programming (oops)  oops concepts   inheritance  object oriented programming (oops)  oops concepts   oops concept     Asked in 10 Companies        frequent


 Q143. What are the two main components of Hadoop System ?BigData
Ans. Distributed file system and Map Reduce system.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop  bigdata  hadoop system components        frequent


 Q144. What is Hadoop Framework ?BigData
Ans. Hadoop is an open source framework , written in java by apche software foundation. This framework is used to write applications to process vast amount of data. Processing happens in parallel on large clusters which could have 1000 of computers. It processes data in a very reliable and fault tolerant manner.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Hadoop framework  BigData


 Q145. What is the use of Combiners ?BigData
Ans. Combiners are used to increase the efficiency of a Map Reduce program. They are used to aggregate intermediate map output locally on individual mapper outputs. Combiners can help you reduce the amount of data that needs to be transferred across to the reducers.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Hadoop Systems  BigData   hadoop combiners     Asked in 1 Companies


Very Frequently asked to fresh graduates and less experienced.
 Q146. What are the principle concepts of Object Oriented Programming ?Core Java
Ans. Abstraction Polymorphism Inheritance Encapsulation

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     oops  oops concepts     Asked in 1 Companies      basic        frequent


 Q147. What is multilevel inheritance ?Core Java
Ans. Multi Level Inheritance is multi level hierarchy of classes. Here is the example - http://www.buggybread.com/2015/09/java-se-class-diagram-classes-that_603.html

Class RoleList extends ArrayList which in turn extends AbstractList which in turn extends AbstractCollection.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     multilevel inheritance  object oriented programming (oops)  oops concepts  inheritance  object oriented programming (oops)  oops concepts  oops concepts     Asked in 3 Companies      basic

Try 1 Question(s) Test


 Q148. Does default methods introduce multiple inheritance and the Diamond problem in Java 8 ?Core Java
Ans. Default methods results in multiple inheritance of behavior and not of state. In case we try to implement multiple interfaces with default method having same name and signature, and don't override it in implementation class, it will throw an error.

For example -

interface MyInterface {
public void default myMethod(){
}
}

interface MyInterface2 {
public void default myMethod(){
}
}

class MyClass implements MyInterface,MyInterface2 {
}

This code will compilation error "Duplicate Default Method"

if we specify the definition of myMethod() in myClass, compiler won't complain and there is no conflict and MyClass can use overridden definition. But if we don't override myMethod() in MyClass, Java would be in conflict as to what definition should be carried to MyClass and hence throws compilation error.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     default methods  java 8  multiple inheritance  object oriented programming (oops)  oops concepts  diamond problem   interfaces


 Q149. Can we access private members of the parent class ? i.e Are private members of the class visible in the derived class ?Core Java
Ans. No, If both Parent and Derived are outer classes.

public class Vehicle {
private static String manufacturingDate = "2016";
}

public class Car extends Vehicle{
public static void main(String args[]){
System.out.println(manufacturingDate); // error - The field Vehicle.manufacturingDate is not visible
}
}

Yes, If derived is the inner class of Parent.

public class Vehicle {
private static String manufacturingDate = "2016";
static public class Car extends Vehicle{
public static void main(String args[]){
System.out.println(manufacturingDate); // no problem
}
}
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     private members   private methods   private variables   inheritance  object oriented programming (oops)  oops concepts   members visibility   inner classes  nexted classes      basic        frequent


 Q150. Difference between multiple and multi level inheritance ?Core Java
Ans. Multiple Inheritance refers to the concept of a class inheriting multiple classes. Example - Class C extends Class A ,Class B. This is not allowed in Java.

Multilevel Inheritance refers to the concept of Inheritance in a chain. Example - Class B extends Class A, Class C extends Class B. This is permitted in Java.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     inheritance  object oriented programming (oops)  oops concepts   multiple inheritance  object oriented programming (oops)  oops concepts   multi level inheritance  object oriented programming (oops)  oops concepts      Basic        frequent


 Q151. Can you name some of the Java frameworks in different domains ?Frameworks
Ans. Web Framework - Spring , Struts, Play
Dependency Injection frameworks - Google Guice , PicoContainer and Dagger
ORM Framework - Hibernate
Big Data / ETL Frameworks - Apche Hadoop , Apache Crunch, Apache Spark.
View Frameworks - JSF , Apache Wicket,jtwig.
Java Gui Frameworks - SWT , AWT, JavaFX
Testing - Junit, Mockito, PowerMock, EasyMock, JMock, JMockit
Rest Web services - Jersey , Restlet , RestX, RestEasy ,Restfulie

Here is the big list for reference - http://javasearch.buggybread.com/home2.php?keyword=

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     frameworks     Asked in 2 Companies      intermediate        frequent


  Q152. What are the core OOPs concepts ?Core Java
Ans. Abstraction, Encapsulation, Polymorphism , Composition and Inheritance

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     core oops concepts     Asked in 65 Companies      basic        frequent


 Q153. How are the concept of Association related to Composition and Inheritance ?Core Java
Ans. Composition and Inheritance are the different types of Associations for Classes.

Composition is a has-a association between classes.
Inheritance is a is-a association between classes.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     composition  object oriented programming (oops)  oops concepts  inheritance  object oriented programming (oops)  oops concepts  association  relationship between objects


 Q154. how many reducer task runs on a hadoop cluster ?BigData
Ans. Generally one reducer runs for all mappers, but it can be increased as per requirements.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Hadoop  BigData     Asked in 1 Companies


 Q155. Is it a good design practice to have programming constructs like if and loops in constructor ?Design
Ans. I would avoid that. If we need to initialize member elements differently on the basis of some condition, I would prefer having overloaded constructors. I don't see a need to have a loop for initializing member elements unless the count of elements is huge and they all need to be initialized with common value.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     design constructor  for loop


 Q156. What are the counter controlled repetitions in java ? Core Java
Ans. Counter controlled repetitions are the loops that are controlled with the use of counters or the loops where the number of repetitions are known in advance. for loop in java is the counter controlled repetition.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     for loop  control statements  loop statement


 Q157. Which of the two - compile time and run time polymorphism - requires signature of the method to be different ?Core Java
Ans. runtime polymorphism or method overriding doesn't require method name and signature to be different whereas compile time polymorphism or method overloading requires method name to be same but the signature to be different.

 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  overloading  overriding      basic


 Q158. What is "dynamic method dispatch" in java ?Core Java
Ans. dynamic method dispatch is a process in which a call to an
overridden method is resolved at runtime rather than at compile-time. This is used to achieve runtime polymorphism in java.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     overriding  runtime polymorphism  object oriented programming (oops)  oops concepts


 Q159. How do you take screenshot in selenium?Selenium
Ans. TakeScreenshot th = TakeScreenshot(driver); //Enable the driver object to take screenshot

File src = th.getScreenShotAs(OutputType.FILE);

FileUtils.copyFilesrc("locationWhereUWantToPlaceTheScreenshot.jpg");

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     webdriver  selenium     Asked in 1 Companies


 Q160. What is dynamic dispatch in Java ?Core Java
Ans. Dynamic dispatch in java is also known as runtime polymorphism.It is a process in which a call to an overriden method is resolved at runtime.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     dynamic dispatch  runtime polymorphism  object oriented programming (oops)  oops concepts


previous 30   next 30

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: