Hadoop Questions and Answers – Java Interface

This set of Hadoop Multiple Choice Questions & Answers (MCQs) focuses on “Java Interface”.

1. In order to read any file in HDFS, instance of __________ is required.
a) filesystem
b) datastream
c) outstream
d) inputstream
View Answer

Answer: a
Explanation: InputDataStream is used to read data from file.

2. Point out the correct statement.
a) The framework groups Reducer inputs by keys
b) The shuffle and sort phases occur simultaneously i.e. while outputs are being fetched they are merged
c) Since JobConf.setOutputKeyComparatorClass(Class) can be used to control how intermediate keys are grouped, these can be used in conjunction to simulate secondary sort on values
d) All of the mentioned
View Answer

Answer: d
Explanation: If equivalence rules for keys while grouping the intermediates are different from those for grouping keys before reduction, then one may specify a Comparator.

3. ______________ is method to copy byte from input stream to any other stream in Hadoop.
a) IOUtils
b) Utils
c) IUtils
d) All of the mentioned
View Answer

Answer: a
Explanation: IOUtils class is static method in Java interface.

4. _____________ is used to read data from bytes buffers.
a) write()
b) read()
c) readwrite()
d) all of the mentioned
View Answer

Answer: a
Explanation: readfully method can also be used instead of read method.

advertisement
advertisement

5. Point out the wrong statement.
a) The framework calls reduce method for each <key, (list of values)> pair in the grouped inputs
b) The output of the Reducer is re-sorted
c) reduce method reduces values for a given key
d) None of the mentioned
View Answer

Answer: b
Explanation: The output of the Reducer is not re-sorted.

6. Interface ____________ reduces a set of intermediate values which share a key to a smaller set of values.
a) Mapper
b) Reducer
c) Writable
d) Readable
View Answer

Answer: b
Explanation: Reducer implementations can access the JobConf for the job.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

7. Reducer is input the grouped output of a ____________
a) Mapper
b) Reducer
c) Writable
d) Readable
View Answer

Answer: a
Explanation: In the phase the framework, for each Reducer, fetches the relevant partition of the output of all the Mappers, via HTTP.

8. The output of the reduce task is typically written to the FileSystem via ____________
a) OutputCollector
b) InputCollector
c) OutputCollect
d) All of the mentioned
View Answer

Answer: a
Explanation: In reduce phase the reduce(Object, Iterator, OutputCollector, Reporter) method is called for each pair in the grouped inputs.

advertisement

9. Applications can use the _________ provided to report progress or just indicate that they are alive.
a) Collector
b) Reporter
c) Dashboard
d) None of the mentioned
View Answer

Answer: b
Explanation: In scenarios where the application takes a significant amount of time to process individual key/value pairs, this is crucial since the framework might assume that the task has timed-out and kill that task.

10. Which of the following parameter is to collect keys and combined values?
a) key
b) values
c) reporter
d) output
View Answer

Answer: d
Explanation: The reporter parameter is for a facility to report progress.

advertisement

Sanfoundry Global Education & Learning Series – Hadoop.

Here’s the list of Best Books in Hadoop.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.