Interview Questions.

Top 100+ Java Hadoop Developer Interview Questions And Answers


Top 100+ Java Hadoop Developer Interview Questions And Answers

Question 1. Which Is The Only Variable That Needs To Be Set In The Conf/hadoop-env.Sh File For Hadoop Mapreduce To Work?

Answer :

JAVA_HOME is the only variable that desires to be set and need to point to the java installation directory.

Question 2. Which Collection Interface In Java Is Used To Maintain Unique Elements?

Answer :

Map interface in Java maps specific keys to values, given a key and price pair- the fee is stored inside the Map object which can be retrieved the usage of the key.

Informatica Interview Questions
Question three. What Platform And Version Of Java Is Required To Work With Apache Hadoop?

Answer :

The advocated java model to with Apache Hadoop is 1.6 or higher, desired from Sun. Windows and Linux are the supported running structures to work with Hadoop but Mac OS is well-known for running with hadoop.

Question four. What Is The Difference Between A Class Variable And An Instance Variable In Java?

Answer :

Class Variables only have a single copy of the variable and are declared with static modifiers. Every item of the elegance stocks a single copy of the magnificence variable, so if any modifications are made to a class variable they may be seen with the aid of all of the gadgets of a category. A magnificence variable is allocated memory while the elegance is loaded first time.

Example of a Class Variable Declaration in Java

Public class Product 

    public static int Barcode;

Instance variables belong to an item and are specified with out a static modifier. Every item of the magnificence may have its own non-public copy of the instance variable unlike class variables wherein unmarried copy of the variable is shared through special items of the magnificence.

Example of an Instance Variable Declaration in Java

public magnificence Product 

   public int Barcode;

Big Data and Hadoop Certification Training

If you would really like greater data about Big Data careers, please click on the orange "Request Info" button on top of this web page.

Informatica Tutorial
Question five. How Will You Achieve Multi-threading In Java?

Answer :

Multithreading in Java may be executed in two approaches :-

By defining a brand new class which implements the runnable interface. An object of that elegance is then surpassed to constructor approach of Thread.
By defining a new class that extends the thread magnificence.
Teradata Interview Questions
Question 6. What Is The Difference Between An Abstract Class And Interface?

Answer :

Interface is different from an summary class because interface is only a kind that may be happy by using a category which implements the interface. Interfaces in java help enforce a couple of inheritance because a class can amplify only another magnificence.

Interface do not have any implementation and just are restrained to constants and public methods while abstract elegance in java can have partial implementation along side static strategies and protected get admission to blocks. A class can increase handiest one abstract elegance however it can put into effect several interfaces.

Question 7. Can You Explain The Difference Between Path And Classpath?

Answer :

These are the running system surroundings variables in which PATH variable defines the gadget where executable files are present while CLASSPATH is used to specify the place of .Elegance documents.

Teradata Tutorial Linux Interview Questions
Question eight. What Is The Return Type Of Main () Method In Java?

Answer :

main () approach in java does not go back some thing and therefore is continually declared as void.

Question nine. As We Know That Abstract Class In Java Cannot Be Instantiated, How Will You Use The Non-static Methods Of An Abstract Class?

Answer :

By extending the summary class it's miles feasible to apply the non-static strategies.

Hadoop Interview Questions
Question 10. Where Can A Protected Method Be Accessed?

Answer :

Any blanketed method can be accessed by way of all the instructions of the equal bundle and also with the aid of the subclass of the magnificence in every other package.

Linux Tutorial
Question eleven. If I Don’t Want A Class To Be Inherited, What Should I Do?

Answer :

The magnificence needs to be declared as ‘final’ to make certain that it can not be prolonged by another magnificence.

Java Interview Questions
Question 12. Is Java The Only Language For Hadoop Jobs To Be Written?

Answer :

It isn't always vital to jot down Hadoop jobs in Java language, there are many different approaches to write hadoop jobs the use of non-java codes. Hadoop Streaming permits hadoop map and decrease responsibilities to be written within the shape of any executable script.

Informatica Interview Questions
Question thirteen. Differentiate Between Throw And Throws In Exception Handling.

Answer :

Throw clause is used whilst a user desires to throw a custom designed explicit exception. Throw clause is used if there's a want for a specific exception to be thrown to the calling method.


if (age>=one hundred) throw new AgeBarException (); //This is a custom designed exception



 Seize (AgeBarException ex) 

...Code to deal with Exception.....

Throws Clause lists all of the exceptions that piece of code would possibly throw. Throws clause provides a warning to the invoking approach that these are the list of exceptions it'd throw and a lot of these need to be treated.

Throws is used to declare an exception whereas throw clause is used to explicitly throw an exception.
Throws clause is particular in the method signature while throw clause is used inside a method.
Throws clause is frequently observed by way of a class while throw clause is often accompanied through an example.
Hadoop Tutorial
Question 14. How Will You Find If Two Strings Are Same Or Not?

Answer :

Two strings in Java can be as compared using the equals () approach and not ==. Using == to evaluate strings will compare if the 2 string variables factor to the same example of a string object and no longer the real cost of the strings.

Question 15. How Will You Create The Object Of An Abstract Class?

Answer :

Objects cannot be created for an summary class.

Hadoop MapReduce Interview Questions
Question 16. I Want To Place The Compiled Java Class Files In A Directory Named Desire. How Will You Do That?

Answer :

Use java – d .Java. This command will vicinity the compiled class documents in a listing called Java.

Java Tutorial
Question 17. What Do You Understand By Mutable And Immutable Objects?

Answer :

If the cost of the object can be changed then it's miles known as a Mutable object. If after the introduction of an items, it cost can't be modified then it's miles an immutable item. String, Integer, Float in java are examples of immutable item while StringBuffer item is an instance of mutable object in java.

Apache Pig Interview Questions
Question 18. What Is The Difference Between Method Overloading And Overriding In Java?

Answer :

Method overloading happens during assemble time inside a class while Method Overriding occurs among two classes that have IS-A i.E. Inheritance dating. For method overriding we require determine and toddler classes whereas for method overloading a single class is sufficient.

Static binding is used for method overloading as the call to the overloaded technique is made all through the assemble time whereas dynamic binding is used for method overriding as the decision to the overridden approach is made at run time.
Method overloading requires unique argument listing to the technique while in technique overriding the argument list has to be same.
Method overloading gives better overall performance over approach overriding for the reason that binding of the overloaded strategies is executed at bring together time and no longer run time.
Teradata Interview Questions
Question 19. What Happens If You Do Not Provide Any Package Declaration In Your Java Programming Code?

Answer :

When no package deal assertion is particular, java.Lang package receives imported with the aid of default.

Hadoop MapReduce Tutorial
Question 20. What Is The Fundamental Difference Between Shallow Copy And Deep Copy In Java?

Answer :

In Shallow copy a brand new object is created that has the same values like the original object. If any of the fields in the object reference different objects if so best the memory address is copied.

In deep reproduction all fields are copied and copies are created for dynamically allotted reminiscence that points to by means of the fields. In deep reproduction, an item is copied together with the other items it refers to.

The default model of the clone () method will create a shallow reproduction of the object.

Machine learning Interview Questions
Question 21. Explain About Garbage Collection In Java?

Answer :

Java manages memory automatically by means of putting off the unused variable or items from the reminiscence. This system is called garbage collection. User java programs cannot unfastened the object memory , so the garbage collector (gc) in java free’s the gadgets or variables which might be no longer being utilized by a application. JVM considers an object or variable as alive so long as it's miles being referenced by a application. Once it finds that the object cannot be reached by way of the program code, it's miles removed and so that the unused reminiscence can be reclaimed.

Question 22. Where Should The Package Statement Appear Within A Java Source Code File?

Answer :

The bundle assertion need to constantly be the very first line of a java program code.

Apache Pig Tutorial
Question 23. How Will You Implement Multiple Inheritance In Java?

Answer :

Java does without delay support more than one inheritance unlike C++ but more than one inheritance can be implemented in Java through interfaces.

NoSQL Interview Questions
Question 24. How Do You Achieve Abstraction In Java?

Answer :

Abstraction way revealing handiest the specified implementation information and hiding the inner info. Interfaces and abstract classes in java help achieve abstraction in Java.

Linux Interview Questions
Question 25. Is There Any Root Class For All Classes Declared In A Java Program?

Answer :

“Object” magnificence is the basis magnificence of all lessons in java. Any class written in a java application extends the item class gift inside the default java.Lang package deal.

HBase Tutorial
Question 26. How Can You Create A Deep Copy Of The Complete Java Object Along With Its State?

Answer :

A deep copy of the entire java item can be created by means of having the class implement the cloneable interface and make a name to its clone () approach.

HBase Interview Questions
Question 27. What Are The Access Specifiers Available In Java?

Answer :

Java has 4 ranges of access specifiers:-

Private -Variables, strategies lessons and constructors are seen most effective to the elegance.
Protected – Variables, methods classes and constructors are visible to the package deal and additionally inside all of the subclasses.
Public - Variables, strategies instructions and constructors are visible everywhere.
Default- Visible to the package and there may be no unique keyword to specify this get admission to specifier, it's far declared with the aid of default.
Hadoop Interview Questions
Question 28. What Do You Understand By Transient Variables In Java?

Answer :

Java has a special key-word called transient which suggests that a variable ought to not be serialized while it's far saved to streams of bytes. Whenever an object is transferred through a network it must be serialized to transform the object country into serial bytes.

Transient variables are initialized by way of their default value during de-serialization. For instance, for item transient variable, the price could be NULL.

Elasticsearch Tutorial
Question 29. Is It Mandatory To Have A Catch Block After Every Try Block In The Program Code?

Answer :

It isn't always essential to have a seize block after every try block in the application code. All exceptions which are in all likelihood to be thrown should be noted inside the throws clause of the technique observed by means of both a trap block or a ultimately block.

Elasticsearch Interview Questions
Question 30. Under What Circumstances Is The Finally Block Not Executed?

Answer :

If this system terminates because of a fatal blunders or it exits by means of calling the system.Exit () technique then sooner or later block isn't finished.

Question 31. What Is Synchronization In Java?

Answer :

The method of tracking the access to shared assets by a couple of threads in order that handiest one thread can get entry to one aid at time is referred to as synchronization. Synchronization is used to keep away from records consistency and corruption troubles and also to prevent any kind of thread interference.

Java provides a unique key-word called “synchronized” which can be used both for synchronizing a block of code or for synchronizing a method.

The keyword “synchronized” can be used a part of the technique announcement.
Or a block of code can be positioned in synchronized key-word the use of ‘this’ java operator.
MongoDB Tutorial
Question 32. Write An Indefinite Loop In Java?

Answer :

for (;;)  


whilst (authentic)


MongoDB Interview Questions
Question 33. What Are The Different Ways Of Creating A String Object In Java?

Answer :

String objects in java can be created either with the aid of the use of the new key-word or via the usage of a string literal.

String Creation the usage of a Literal –

String str= “DeZyre”;

String Object Creation the use of the “new” operator -

String str=new String ("DeZyre"); //creates two items and one reference variable

Java Interview Questions
Question 34. Differentiate Between A Process And A Thread?

Answer :

In simple terms, threads are part of a manner i.E. A single method in java can spawn a couple of threads.  Threads and procedures in Java are independent paths of execution .A method gets its own reminiscence address area whereas a thread shares the heap area belonging to the parent method. Every technique in java has a completely unique system identifier, executable code and memory area while a thread has its personal stack in Java but uses the manner reminiscence and stocks it with different threads.

Question 35. How Many Objects Will Be Created On Executing The Following Code For Creation Of A String Using The String Literal?

Answer :

String str1=”DeZyre”;

String str2=”DeZyre”;

String str3=”DeZyre”;

Only one object can be created because whenever while we create a string literal, the JVM checks for the presence of the string in the string steady pool. Only if the string is not present inside the pool then a brand new string example might be created, otherwise a reference to the pooled example is returned.

Question 36. Can You Use An Anonymous Class To Implement An Interface And Extend Another Class?

Answer :

Yes, it's far viable for an anonymous class to put in force an interface and extend a remarkable magnificence however it can't be used to do both on the identical time inside the equal announcement.

Hadoop MapReduce Interview Questions
Question 37. We Know That The Garbage Collector In Java Cleans Up Memory But Still It Does Not Guarantee That Program Will Run Out Of Memory. Can You Explain The Reason For This?

Answer :

Java programs may dissipate the memory resources at a miles faster pace than they're genuinely rubbish accumulated and additionally the program may create objects which can not be rubbish accumulated.

Question 38. How Will You Declare A Pointer In Java?

Answer :

Java does now not aid pointers due to reliability and memory leak issues.

Question 39. Can You Define A Class Inside An Interface?

Answer :

Yes but via default the elegance is static.

Question 40. Filenotfoundexception Is Inherited From The Base Class Ioexception. When Trying To Catch Blocks For These Exceptions, Is It Necessary To Follow A Particular Order For The Catch Block Statements?

Answer :

Yes it's far crucial to observe a selected order for the trap block announcement for the two exceptions. The subclasses exception i.E. FileNotFoundException has to be caught first.

Apache Pig Interview Questions
Question forty one. What Will Be The Initial Value Of An Object Reference That Is Declared As An Instance Variables?

Answer :

All item reference variables in Java are assigned a NULL fee.

Question 42. In A Java Program, We Usually Follow The Main Method Declaration As Public Static Void Main (). What Will Happen If I Alter The Order Of Public And Static Declaration For The Main () Method In A Java Program?

Answer :

Changing the order of the keywords ‘public’ and ‘static’ inside the essential () method statement of a Java application does no longer rely however one should constantly make certain that the go back sort of the main () approach i.E. Void must constantly appear earlier than principal ().

Machine gaining knowledge of Interview Questions
Question 43. What Is The Base Class For Exception And Error In Java?

Answer :


Question 44. Can You Declare Multiple Classes In Your Java Source Code File?

Answer :

A unmarried java application may have any quantity of sophistication declarations however simplest one magnificence can be declared as Public.

Question forty five. I Have 10 .Java Files In A Folder. What Is The Process To Compile All The Files Using A Single Command Line Execution Instead Of Compiling Each .Java File Separately?

Answer :

Executing the “javac *.Java “command from the listing vicinity will assemble all of the files present in the folder with .Java extension.

Question 46. Write A Java Line Of Code To Declare A Class As Protected?

Answer :

Only methods may be declared as included in Java and now not lessons.

Question forty seven. What Is The Basic Difference Between A Queue And A Stack Data Structure?

Answer :

Queue follows the first in first out (FIFO) rule whereas stack follows the last in first out rule (LIFO)

Question forty eight. What Is The Advantage Of Using A String Literal In Java?

Answer :

Using a string literal to create strings makes java memory greater green as no new gadgets are created in the event that they already exist inside the string consistent pool.

Question 49. Is It Necessary To Declare A Main () Method Inside All Java Classes?

Answer :

It isn't always necessary to claim a chief () method internal all java classes except the supply class is a java application.

Question 50. Can You Name Any Final Classes Defined In The Java Api?

Answer :

Java.Lang.Math and java.Lang.String are some examples of final lessons in Java API.