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
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
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
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
Explanation: readfully method can also be used instead of read method.
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
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
Explanation: Reducer implementations can access the JobConf for the job.
7. Reducer is input the grouped output of a ____________
a) Mapper
b) Reducer
c) Writable
d) Readable
View Answer
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
Explanation: In reduce phase the reduce(Object, Iterator, OutputCollector, Reporter) method is called for each
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
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
Explanation: The reporter parameter is for a facility to report progress.
Sanfoundry Global Education & Learning Series – Hadoop.
Here’s the list of Best Books in Hadoop.
- Check Hadoop Books
- Apply for Computer Science Internship
- Practice Programming MCQs
- Check Programming Books