Hadoop Overview
- 26Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What are the three major reasons for the rise of big data according to Cisco?
26 questions
- 1
What are the three major reasons for the rise of big data according to Cisco?
Model answer
The three major reasons are adapting to smarter mobile devices, defining cell network advances (e.g., from 2G to 5G), and reviewing tiered pricing (unlimited data plans).
Explanation
Cisco identified these three factors because smartphones generate data through apps, faster networks enable easier sharing, and affordable data plans encourage more usage.
- 2
Provide two statistics that illustrate the massive amount of data generated on social media every 60 seconds.
Model answer
On Facebook, users generate almost 4 million likes every 60 seconds. On YouTube, almost 300 hours of new video are uploaded every 60 seconds.
Explanation
These stats show how social media contributes to big data. Other examples include 300,000 tweets on Twitter, 18,000 Reddit user cast votes, and over 1 million Instagram likes per 60 seconds.
- 3
How does the content define big data?
Model answer
Big data is defined as a problem that surrounds the incapabilities of a traditional system to process large volumes of data generated at high speed and in various formats.
Explanation
Big data is not just large datasets; it is a problem because traditional systems cannot store or process such huge amounts of data efficiently.
- 4
Explain the 5Vs of big data as proposed by IBM.
Model answer
The 5Vs are Volume (large amount of data), Variety (different data types from various sources, mostly unstructured), Velocity (high speed of data generation), Value (ability to extract useful insights), and Veracity (trustworthiness and reliability of data).
Explanation
These Vs help identify whether a dataset qualifies as big data and highlight the challenges that require distributed solutions like Hadoop.
- 5
In the context of the 5Vs, what does 'Variety' refer to and why is it a problem?
Model answer
Variety refers to the different types of data (structured, semi-structured, unstructured) from various sources. It is a problem because about 90% of data is unstructured, and traditional systems cannot process it effectively.
Explanation
Unstructured data includes videos, images, and JSON files. Despite being difficult to process, this data is valuable for profiling customers and making business decisions.
- 6
In the Bob's restaurant analogy, what does the 'food shelf' represent in Hadoop, and what problem did distributing it solve?
Model answer
The food shelf represents the data warehouse. Distributing it solved the bottleneck problem where multiple cooks accessing a single shelf caused delays. In Hadoop, this is solved by data localityโeach processing node has local data, reducing network congestion.
Explanation
By giving each chef their own shelf (data locality), parallel processing becomes efficient. This is analogous to storing data on each node in a Hadoop cluster instead of a central warehouse.
- 7
In the Bob's restaurant story, which parts correspond to Map and Reduce in Hadoop?
Model answer
The parallel cooking tasks (e.g., one chef cooking meat, another cooking sauce) correspond to the Map phase. The head chef combining the meat and sauce into a final dish corresponds to the Reduce phase.
Explanation
Map processes data in parallel across nodes, while Reduce aggregates the intermediate results to produce the final output.
- 8
What is Hadoop and what are its two core components?
Model answer
Hadoop is a framework that allows distributed storage and processing of large datasets. Its core components are HDFS (Hadoop Distributed File System) for storage and MapReduce for processing.
Explanation
HDFS stores data across multiple machines, and MapReduce processes that data in parallel and distributed manner.
- 9
Describe the master/slave architecture of Hadoop using HDFS components.
Model answer
In HDFS, the master node is called the NameNode, which manages the file system namespace and metadata. The slave nodes are DataNodes, which store the actual data blocks. The NameNode tracks DataNodes via heartbeat signals.
Explanation
The master/slave architecture ensures centralized management (NameNode) and distributed storage (DataNodes), allowing fault tolerance and scalability.
- 10
What is the role of the Secondary NameNode and how does it perform checkpointing?
Model answer
The Secondary NameNode performs checkpointing by combining the FS image (full metadata snapshot) with the edit log (recent changes) to create a new FS image. This prevents the edit log from growing too large and speeds up failure recovery.
Explanation
Checkpointing happens every hour by default. The Secondary NameNode has copies of FS image and edit log, merges them, and returns the new FS image to the NameNode.
- 11
What is the default block size in HDFS and how does HDFS handle storage of files that are not multiples of the block size?
Model answer
The default block size is 128 MB. For a 380 MB file, HDFS creates three blocks: two 128 MB blocks and one 124 MB block (the remaining size). This saves space because the last block uses only the needed space.
Explanation
HDFS divides files into blocks of fixed size except the last block, which is smaller. This avoids wasting storage space.
- 12
List three advantages of using a distributed file system like HDFS.
Model answer
- Abstraction of a single large storage system. 2) Scalability: adding more nodes increases storage capacity. 3) Parallel processing: multiple nodes can read data simultaneously, reducing processing time.
Explanation
These advantages make HDFS suitable for big data: it appears as one large disk, can grow by adding nodes, and speeds up data processing via parallelism.
- 13
What is the default replication factor in HDFS and why is it set to that value?
Model answer
The default replication factor is 3. It ensures fault tolerance because even if one or two replicas are lost, the data remains accessible. Hadoop runs on commodity hardware where failures are common.
Explanation
By storing three copies of each block across different DataNodes, HDFS can survive multiple node failures without data loss.
- 14
Describe the three steps involved in writing a file to HDFS.
Model answer
- Pipeline setup: client requests NameNode for block locations, then sets up a pipeline among the chosen DataNodes. 2) Actual writing: client writes the block to the first DataNode, which forwards it to the second, and so on, all in parallel across blocks. 3) Acknowledgment: acknowledgments flow back from the last DataNode to the client, confirming all replicas are written.
Explanation
This process ensures that data is replicated reliably across the cluster. For multiple blocks, writing happens simultaneously across different pipelines.
- 15
How does the read mechanism work in HDFS?
Model answer
The client sends a request to the NameNode for the file's block locations. The NameNode returns the DataNode addresses for each block. The client then fetches blocks directly from the DataNodes in parallel and assembles the file.
Explanation
Reading is simpler than writing because no replication is involved. The client contacts the nearest DataNode for each block to optimize performance.
- 16
Explain the concept of MapReduce using the professor and students story.
Model answer
A professor wants to count occurrences of 'Julius' in a book. Initially, students each read the whole book (slow). Alternatively, each student is assigned one chapter (parallel map), and the professor adds the results (reduce). This reduces time from 4 hours to about 1 hour.
Explanation
Map divides the task into independent subtasks processed in parallel, and Reduce aggregates the intermediate results to produce the final answer.
- 17
In the word count MapReduce example, what is the intermediate output format and how is it processed?
Model answer
Each mapper outputs key-value pairs where the key is a word (Text) and the value is 1 (IntWritable). After shuffling and sorting, each reducer receives a list of values for each key and sums them to produce the final count.
Explanation
The intermediate output is (word, 1) pairs. The shuffle phase groups by key, and the reduce phase aggregates counts.
- 18
What classes and methods are required in a typical MapReduce program?
Model answer
The Mapper class extends
Mapper<LongWritable, Text, Text, IntWritable>and overrides themapmethod. The Reducer class extendsReducer<Text, IntWritable, Text, IntWritable>and overrides thereducemethod. The Driver class sets job configuration (job name, mapper/reducer classes, input/output paths).Explanation
The mapper processes input splits and emits key-value pairs. The reducer aggregates values for each key. The driver configures and runs the job.
- 19
What data types are commonly used for map output key and value in a word count program?
Model answer
The map output key is
Text(the word) and the map output value isIntWritable(the count 1). The input key isLongWritable(byte offset) and input value isText(one line).Explanation
Hadoop uses Writable data types for serialization. LongWritable, Text, and IntWritable are common.
- 20
What is the role of the driver code in a MapReduce job?
Model answer
The driver code configures the job: sets the job name, mapper and reducer classes, output key/value types, and the input/output paths. It also submits the job to the cluster for execution.
Explanation
The driver acts as a configuration hub that tells Hadoop how to run the MapReduce job.
- 21
List the four main components of YARN and briefly describe the function of each.
Model answer
- ResourceManager: master, receives job requests and allocates resources. 2) NodeManager: runs on slave nodes, manages containers and monitors resource usage. 3) AppMaster: per-application, negotiates resources and monitors job progress. 4) Container: provides CPU and RAM for executing tasks.
Explanation
YARN separates resource management (RM/NM) from job coordination (AppMaster), enabling better scalability and multi-framework support.
- 22
Describe the MapReduce job workflow in YARN, starting from client submission.
Model answer
- Client submits the job to ResourceManager (RM). 2) RM replies with an application ID and asks a NodeManager to start a container. 3) The container launches an AppMaster for the job. 4) AppMaster negotiates resources from RM. 5) AppMaster launches containers (YARN children) to execute map and reduce tasks. 6) Tasks run in parallel, producing intermediate outputs that are shuffled and sorted before reduce.
Explanation
The workflow ensures efficient resource allocation and execution. The AppMaster coordinates the job lifecycle.
- 23
What is the default size of the map output circular buffer, and what happens when it reaches the spill threshold?
Model answer
The default size is 100 MB. When the buffer reaches 80% (threshold), a background thread spills the contents to disk. During spill, map outputs continue to be written to the buffer, but if it fills, the map blocks until spill completes.
Explanation
Spilling prevents memory overflow. Multiple spill files are merged into a single sorted output per map task.
- 24
What are the three modes in which a Hadoop cluster can be configured?
Model answer
- Standalone/Local mode: all daemons run on a single VM, no distribution. 2) Pseudo-distributed mode: all daemons run on the local machine but are logically separate. 3) Multi-node cluster mode: daemons run on multiple machines, providing true distribution and redundancy.
Explanation
Multi-node mode is recommended for production because it offers scalability and fault tolerance. Pseudo-distributed is for learning purposes only.
- 25
Name at least four tools in the Hadoop ecosystem and state their primary function.
Model answer
Flume: ingests unstructured/semi-structured data. Scoop: ingests structured data. Hive: provides SQL-like queries for analysis. Pig: offers a scripting language (Pig Latin) for data transformations. Spark: used for real-time processing and machine learning.
Explanation
The Hadoop ecosystem includes many tools for data ingestion, storage, processing, analysis, and management. Each serves a specific purpose.
- 26
In the Pig use case on Olympic data, what sequence of Pig commands was used to find the top 10 countries with the highest number of medals?
Model answer
- LOAD data into a variable (e.g.,
olympic = LOAD '...' USING PigStorage('\t')). 2) FOREACH GENERATE country and total medals. 3) GROUP BY country. 4) FOREACH GENERATE group, COUNT(country_final.total_medals) to get totals. 5) ORDER BY count DESC. 6) LIMIT 10. 7) STORE into output.
Explanation
Pig Latin automatically translates these commands into MapReduce jobs. The steps mirror the MapReduce word count logic but with simpler syntax.
- LOAD data into a variable (e.g.,

Ask anything
We've read this whole study set, so questions about it get the best answers.