Practice Library
All MCQs
Browse exam-wise, subject-wise, and country-wise MCQs with explanations.
Choose an option to check your answer.
A.
The degree of parallelism and the number of output part files
B.
The number of HDFS blocks in every input file
C.
The mapper source code
D.
The NameNode replication factor
Show Answer
Correct Answer: A. The degree of parallelism and the number of output part files
Explanation:
More reducers can process partitions concurrently but create more outputs and overhead.
The best count depends on data size, resources, and skew.
Choose an option to check your answer.
A.
When a global total is required
B.
When all values for a key must be combined
C.
When a join requires grouping
D.
When each record can be transformed without grouping across records
Show Answer
Correct Answer: D. When each record can be transformed without grouping across records
Explanation:
Independent filtering or field conversion can finish in mappers.
Avoiding reducers eliminates shuffle and sort overhead.
Choose an option to check your answer.
A.
A job containing no mappers
B.
A job that reads no input
C.
A MapReduce job configured with zero reducers
D.
A job that stores only metadata
Show Answer
Correct Answer: C. A MapReduce job configured with zero reducers
Explanation:
Map-only jobs are suitable when records can be processed independently.
Mapper output is written directly as final output.
Choose an option to check your answer.
A.
HDFS cannot store key-value pairs
B.
It is temporary data that can be regenerated if the mapper fails
C.
Reducers cannot read HDFS
D.
Local disk is always replicated
Show Answer
Correct Answer: B. It is temporary data that can be regenerated if the mapper fails
Explanation:
Intermediate output is consumed by reducers and is not final durable data.
Re-execution is often cheaper than HDFS replication.
Choose an option to check your answer.
A.
Writing buffered intermediate mapper data to local disk
B.
Writing final reducer output directly to the NameNode
C.
Moving HDFS replicas to another rack
D.
Deleting failed map tasks
Show Answer
Correct Answer: A. Writing buffered intermediate mapper data to local disk
Explanation:
Mapper output is buffered, partitioned, and sorted in memory.
When thresholds are reached, sorted runs spill to local storage.
Choose an option to check your answer.
A.
All tasks use the same key
B.
The NameNode remains in safe mode
C.
Every mapper runs twice
D.
Only successful task output becomes visible as final job output
Show Answer
Correct Answer: D. Only successful task output becomes visible as final job output
Explanation:
Task attempts may fail or be speculated.
Commit protocols prevent partial or duplicate files from appearing as final results.
Choose an option to check your answer.
A.
To divide input into mapper splits
B.
To choose the reducer partition
C.
To define how final key-value pairs are written
D.
To compile Scala source
Show Answer
Correct Answer: C. To define how final key-value pairs are written
Explanation:
OutputFormat controls destination structure and serialization.
It also creates the RecordWriter used by tasks.
Choose an option to check your answer.
A.
Writes reducer output to HDFS
B.
Converts an InputSplit into input key-value records for the mapper
C.
Monitors DataNode heartbeats
D.
Chooses the YARN scheduler
Show Answer
Correct Answer: B. Converts an InputSplit into input key-value records for the mapper
Explanation:
The RecordReader interprets the bytes within a split.
For text input, it commonly emits byte offsets and lines.
Choose an option to check your answer.
A.
To define how input data is split and converted into records
B.
To sort reducer output
C.
To allocate containers
D.
To replicate HDFS blocks
Show Answer
Correct Answer: A. To define how input data is split and converted into records
Explanation:
InputFormat creates InputSplits and RecordReaders.
It adapts different file structures to the key-value processing model.
Choose an option to check your answer.
A.
A physical HDFS replica
B.
A reducer's final output file
C.
A YARN scheduling queue
D.
A logical portion of input assigned to one map task
Show Answer
Correct Answer: D. A logical portion of input assigned to one map task
Explanation:
InputFormat creates splits that define parallel map work.
A split may correspond closely to an HDFS block but is a logical concept.
Choose an option to check your answer.
A.
Averages cannot be represented numerically
B.
Reducers cannot receive two values
C.
Groups may have different counts, so partial averages need weights
D.
Combiners require text output
Show Answer
Correct Answer: C. Groups may have different counts, so partial averages need weights
Explanation:
An average of averages is wrong when group sizes differ.
Emitting partial sums and counts enables a correct final average.
Choose an option to check your answer.
A.
Computing an unweighted average from partial averages
B.
Summing counts for the same key
C.
Selecting a globally ordered median
D.
Assigning unique sequence numbers
Show Answer
Correct Answer: B. Summing counts for the same key
Explanation:
Addition is associative and commutative, so partial sums can be merged safely.
The same logic works whether aggregation occurs locally or only in reducers.