Hadoop 1, 2 and 3: what changed

Hadoop kept its core ideas but changed its architecture twice. Hadoop 1 had one JobTracker doing everything and fixed slots that wasted resources. Hadoop 2 introduced YARN and a standby NameNode, so many engines could share a bigger, safer cluster. Hadoop 3 added erasure coding, extra standbys, GPU scheduling and newer Java. This lesson explains each change, why it was needed, and the details (like ports) that trip people up in real work.

Module 2 · Why Hadoop was born⏱ 25 minBeginner → Advanced1 vs 2 vs 3 tableCluster Playground (HA)Runs in your browser (Python)8 practice problems
1 The story

Three generations in one office

At Kabir's internship, three engineers sit at the same table. Mr Iyer has run Hadoop since 2010 and still says “check the JobTracker”. Ms Fernandes moved the company to Hadoop 2 in 2014 and talks about “YARN queues”. The new hire, Ananya, set up Hadoop 3 last year and keeps mentioning “erasure coding”. Kabir wonders whether they are even using the same software.

Hadoop 1 (2011) JobTracker: does everything fixed map + reduce slots only MapReduce one NameNode (SPOF) ~4,000 nodes max Hadoop 2 (2013) YARN: RM + AM per job flexible containers Spark, Tez, MapReduce… active + standby NameNode federation, 128 MB blocks Hadoop 3 (2017 →) erasure coding: ~1.5× 2+ standby NameNodes GPUs, Docker on YARN new ports (UI on 9870) 3.5.0 in April 2026 Same idea, three architectures. Each version fixed the biggest pain of the one before. myphatshala.in
Kabir

Sir, are they all talking about the same Hadoop?

Arjun Sir

The same project, three generations. HDFS and the idea of MapReduce stayed. What changed is how the cluster is managed. In Hadoop 1, one process, the JobTracker, managed every job and every machine. It became the bottleneck.

Riya

So Hadoop 2 split that job into pieces?

Arjun Sir

Yes: YARN. A ResourceManager only hands out resources; each job gets its own ApplicationMaster. Suddenly the cluster could run Spark and other engines too, and grow much bigger. Hadoop 2 also fixed the NameNode being a single point of failure.

Kabir

And Hadoop 3?

Arjun Sir

It's about efficiency and modern hardware: erasure coding to cut storage, more than one standby NameNode, GPU scheduling, newer Java. Interviewers love the question “what is the difference between Hadoop 1, 2 and 3?” By the end of today you'll answer it better than most working engineers.

2 Definition

Hadoop 1, 2 and 3

Formal definition (write this in exams)

Hadoop 1 (1.x, first stable release December 2011) consists of HDFS with a single NameNode and MapReduce v1, in which one JobTracker performs both cluster resource management and job scheduling/monitoring, and TaskTrackers run tasks in fixed map and reduce slots. Hadoop 2 (2.x, GA October 2013) introduces YARN, separating resource management (ResourceManager, NodeManagers) from per-application logic (ApplicationMaster), so MapReduce becomes one of many YARN applications; it also adds HDFS High Availability and Federation. Hadoop 3 (3.x, GA December 2017) requires Java 8 or later and adds HDFS erasure coding, more than two NameNodes for HA, new default ports outside the Linux ephemeral range, YARN Timeline Service v2, opportunistic containers and support for resource types such as GPUs.

In simple words

Hadoop 1: one boss (JobTracker) ran every job and every machine, and only MapReduce could run. Hadoop 2: YARN split the boss into a resource manager plus a small manager for each job, so any engine can share the cluster, and the NameNode got a backup. Hadoop 3: saves storage with erasure coding, allows more backups, uses modern hardware like GPUs, and needs a newer Java.

Words you'll meet in this lesson

JobTrackerHadoop 1 master that scheduled every task of every job and tracked all TaskTrackers.
TaskTrackerHadoop 1 worker daemon that ran tasks in its slots.
SlotHadoop 1's fixed place for one task: either a map slot or a reduce slot, never both.
MRv1 / MRv2MapReduce on the JobTracker (Hadoop 1) / MapReduce as a YARN application (Hadoop 2+).
ContainerYARN's flexible unit: an amount of memory and CPU on one node, usable by any kind of task.
HDFS FederationSeveral independent NameNodes, each owning part of the namespace, sharing the same DataNodes.
JournalNodes (QJM)A small group of nodes that store the NameNode edit log so the standby stays up to date.
Erasure codingStoring data plus parity pieces (for example 6 + 3) instead of full copies: survives failures with about 1.5× storage.

Release facts

Hadoop 1.0.027 December 2011
Hadoop 2.2.0 (first GA of 2.x)15 October 2013: YARN, HDFS HA, Federation
Hadoop 3.0.0 GADecember 2017: erasure coding, Java 8 minimum, new ports, multiple standby NameNodes
Hadoop 3.1 and 3.22018–2019: GPU/FPGA scheduling on YARN and other improvements
Hadoop 3.32020: Java 11 runtime support, ARM support, many cloud-connector improvements
Hadoop 3.4.0 / 3.4.3March 2024 / February 2026
Hadoop 3.5.02 April 2026: first stable release of the 3.5 line; server side requires JDK 17 (clients 17 or 21)

Dates from the Apache Hadoop release pages. Check each release's notes for its supported Java versions before installing.

The versions at three levels

Pick your level. New to this? Start at Beginner and climb.

Beginner One principal, or a principal and many class teachers

  • Hadoop 1: one principal personally plans every class, every period and every exam for the whole school. Fine for a small school; impossible for a huge one.
  • Hadoop 2: the principal only assigns classrooms and time (resources). Each class has its own class teacher (ApplicationMaster) who plans that class. Any subject can be taught, not just one.
  • Hadoop 3: the same school, run more efficiently: smaller storerooms (erasure coding), more vice-principals ready to take over (standby NameNodes), science labs with special equipment (GPUs).

Intermediate What exactly changed between 1 and 2

  • JobTracker split in two: the ResourceManager (cluster-wide resources) and one ApplicationMaster per job (task scheduling, retries, progress).
  • Slots → containers: Hadoop 1 nodes had, say, 8 map and 4 reduce slots. If only map tasks were waiting, the reduce slots sat empty. YARN containers can run either kind of task.
  • Beyond MapReduce: any framework that writes an ApplicationMaster can run: Spark, Tez (used by Hive), Flink, and others.
  • HDFS HA: an active and a standby NameNode share the edit log through JournalNodes; ZooKeeper-based failover controllers switch automatically.
  • Federation: several NameNodes can split the namespace (for example /user and /data) so metadata scales beyond one machine's RAM.
  • Default block size 128 MB.

Advanced What Hadoop 3 added, and why it matters

  • Erasure coding: with the RS-6-3 policy, 6 data cells get 3 parity cells: 1.5× storage and tolerance of 3 lost cells, versus 3× for replication. Costs CPU and network to rebuild, so it suits cold data.
  • More than two NameNodes: with three NameNodes and five JournalNodes the cluster survives two NameNode failures.
  • Ports: defaults moved out of the Linux ephemeral range (32768–61000) to avoid clashes; for example the NameNode web UI moved from 50070 to 9870.
  • YARN: Timeline Service v2, opportunistic containers, resource types (GPUs, FPGAs), Docker containers, and Router-based Federation for very large clusters.
  • Cloud storage: much better S3A, Azure and other connectors, so Hadoop tools can read and write object storage directly.
  • Intra-DataNode disk balancer (hdfs diskbalancer) evens out data across the disks inside one node.

Exam tip: The classic question “Differentiate Hadoop 1 and Hadoop 2” expects a table: JobTracker + TaskTracker vs ResourceManager + NodeManager + ApplicationMaster, slots vs containers, MapReduce only vs many engines, NameNode SPOF vs HA, single namespace vs federation, ~4,000 nodes vs much larger, 64 vs 128 MB default block. Add 2–3 Hadoop 3 lines (erasure coding, multiple standbys, Java 8+, port changes) to stand out.

3 Types and ways to use it

Hadoop 1 vs 2 vs 3 at a glance

Hadoop 1Hadoop 2Hadoop 3
Resource managementJobTracker (also schedules tasks)YARN: ResourceManager + NodeManagersYARN, plus opportunistic containers, resource types, Docker
Per-job managementJobTrackerApplicationMaster per jobApplicationMaster per job
Unit of resourcesFixed map / reduce slotsContainers (memory + vcores)Containers, also GPUs/FPGAs
EnginesMapReduce onlyMapReduce, Spark, Tez, …Same, better isolation
NameNode availabilitySingle NameNode (Secondary does checkpoints only)Active + 1 standby (HA)Active + 2 or more standbys
Namespace scaleOne NameNodeFederationFederation + Router-based Federation
Fault tolerance of dataReplication (3×)Replication (3×)Replication or erasure coding (~1.5×)
Default block size64 MB128 MB128 MB
Typical scale limit~4,000 nodes per clusterAround 10,000 nodes per clusterTens of thousands with federation
JavaJava 6Java 7 (later 2.x: 8)Java 8 (3.3/3.4: also Java 11 runtime; 3.5: servers require JDK 17)
NameNode web UI port50070500709870

Scale limits are the commonly quoted design figures; real clusters vary with hardware and workload.

Port numbers that changed in Hadoop 3

ServiceHadoop 2Hadoop 3
NameNode web UI (HTTP)500709870
NameNode web UI (HTTPS)504709871
Secondary NameNode web UI500909868
DataNode data transfer500109866
DataNode IPC500209867
DataNode web UI500759864
ResourceManager web UI80888088 (unchanged)

Many old tutorials still say “open http://localhost:50070”. On Hadoop 3 that page doesn't exist: use 9870. If a guide uses 50070, it is written for Hadoop 2, and other details may be outdated too.

4 Step by step

Why Hadoop 1's JobTracker hit a wall

  1. One process, every decision

    In Hadoop 1, every TaskTracker heartbeats to the JobTracker, and the JobTracker decides every task placement for every running job.

    It also keeps the progress, counters and history of all jobs in its own memory. The more nodes and jobs, the more work for this single process.
  2. Count the load

    nodes, hb_interval_s = 4000, 3
    tasks_running = 40000
    print(nodes // hb_interval_s, "heartbeats per second, tracking", tasks_running, "tasks")
    1333 heartbeats per second, tracking 40000 tasks
    Around 4,000 nodes and 40,000 concurrent tasks is where Hadoop 1 clusters typically topped out. Beyond that the JobTracker became slow or unstable.
  3. Slots waste resources

    Each node had fixed map slots and reduce slots. During a map-heavy phase, reduce slots sat idle even though maps were waiting.

    Utilisation suffered, and an admin had to guess the right map/reduce split for every node.
  4. Hadoop 2 splits the JobTracker

    The ResourceManager only tracks free resources and hands out containers. Each job's ApplicationMaster (running in an ordinary container on a worker) handles its own tasks.

    The heavy, per-job work is now spread across the cluster. The ResourceManager stays small and fast, so clusters can grow much larger.
  5. Any engine can join

    Spark, Tez and others ship their own ApplicationMaster. YARN doesn't care what runs inside a container.

    This is why “Spark on YARN” is so common: one cluster, one storage layer, many engines, shared fairly through queues.
5 See it happen

The same two jobs on Hadoop 1 and on Hadoop 2

A map-heavy job and a Spark job arrive at a 3-node cluster. Left: Hadoop 1 with a JobTracker and slots. Right: Hadoop 2 with YARN and containers.

JobTracker and slots vs YARN and containers 6 steps
Hadoop 1 JobTracker TaskTracker 1TaskTracker 2TaskTracker 3 map slotsmap slotsmap slots reduce slotsreduce slotsreduce slots 6 maps waiting · 6 reduce slots idle Spark job: “I can't run here.” JobTracker overloaded at scale 50% of slots used, MapReduce only each node: 2 map slots + 2 reduce slots 12 map tasks arrive; 6 start myphatshala.in
Hadoop 2 (YARN) ResourceManager NodeManager 1NodeManager 2NodeManager 3 4 containers4 containers4 containers AM AM each node: 4 general containers MapReduce gets an ApplicationMaster (AM) + maps more maps start: no idle “reduce slots” Spark job runs too (orange), with its own AM RM only hands out containers: stays light 100% used, two engines, one cluster myphatshala.in

Try it yourself: Hadoop 2's two big fixes

This cluster runs Hadoop 2+ features: jobs run through the ResourceManager, and the NameNode has a standby. Try the failure that would have stopped a Hadoop 1 cluster.

6 Real-world use

Version changes in real projects

2.x3.x

1. Upgrading from Hadoop 2 to 3

Upgrade projects check Java versions, rewrite scripts for the new shell, update firewall rules and monitoring for the new ports, test jobs on staging, and use HDFS rolling upgrades so the cluster stays available.

Hadoop 2.x→Test + rolling upgrade→Hadoop 3.x
6 + 3EC policy

2. Cutting storage cost with erasure coding

Companies with years of rarely read data apply an erasure-coding policy to archive directories, roughly halving the raw disk needed for them while keeping hot data replicated.

Cold directories→hdfs ec -setPolicy→~1.5× instead of 3×

3. Three NameNodes for critical clusters

Platforms that must keep HDFS available through maintenance and failures run one active and two standby NameNodes (Hadoop 3), so one can be patched while another still protects the cluster.

Active NN→2 standbys + 5 JournalNodes→Survives 2 failures
GPU

4. GPUs on YARN for machine learning

Hadoop 3.1 added GPU scheduling to YARN, so ML teams can train models on the same cluster that stores their data, requesting GPUs like memory and CPU.

Training job→YARN container with GPU→Model
:50070 ✕:9870 ✓

5. Reading old tutorials safely

Much online material was written for Hadoop 1 or 2. Knowing the version differences lets you spot outdated advice: JobTracker commands, port 50070, 64 MB blocks, or Java 7 instructions.

Old guide→Check version clues→Adapt for 3.x

Examples are simplified descriptions of common practice.

7 Run the code

Slots vs containers: measure the waste

In Hadoop 1, each node has fixed map slots and reduce slots. This program fills them with a map-heavy workload and measures how much of the cluster is idle, then does the same with YARN-style containers that can run either kind of task.

nodes = 10
map_slots, reduce_slots = 8, 4          # Hadoop 1: fixed per node
containers = map_slots + reduce_slots    # Hadoop 2: same capacity, any task type

maps_waiting, reduces_waiting = 200, 10

h1_used = min(maps_waiting, nodes * map_slots) + min(reduces_waiting, nodes * reduce_slots)
h2_used = min(maps_waiting + reduces_waiting, nodes * containers)

total = nodes * containers
print(f"Hadoop 1: {h1_used} of {total} busy ({h1_used / total:.0%})")
print(f"Hadoop 2: {h2_used} of {total} busy ({h2_used / total:.0%})")
Hadoop 1: 90 of 120 busy (75%) Hadoop 2: 120 of 120 busy (100%)
  • map_slots, reduce_slots = 8, 4In Hadoop 1, an admin fixed these numbers per node. A reduce slot could never run a map task.
  • h1_used = min(...) + min(...)Map tasks can only use map slots and reduce tasks only reduce slots, so each is capped separately.
  • h2_used = min(maps_waiting + reduces_waiting, nodes * containers)With containers, any waiting task can use any free capacity.
8 Line by line

Placing tasks in slots vs containers, one line at a time

Watch the same five tasks being placed on one node, first with Hadoop 1 slots (2 map + 2 reduce) and then with 4 YARN containers. Notice which tasks are left waiting.

Worked examples: real problems, solved and traced in memory

Three problems from real version decisions: an upgrade checklist, the storage savings of Hadoop 3, and how many NameNodes a cluster needs. Each runs live and is traced in memory.

Example 1BeginnerUpgrade · planning

What must change when moving a cluster from Hadoop 2 to 3?

Problem statement

A team lists its current setup. Print an upgrade checklist: flag Java older than 8, any monitoring that uses old Hadoop 2 ports, and any job still using the Hadoop 1 JobTracker API.

Input
java 7 · monitored ports [50070, 8088, 50075] · jobs [("daily_sales", "mapred"), ("fraud", "mapreduce")]
Expected output
Upgrade Java: Hadoop 3 needs Java 8 or later
Monitoring: change port 50070 to 9870
Monitoring: change port 50075 to 9864
Review job 'daily_sales': uses the old mapred API

Approach

  1. Check the Java version number.
  2. Look up each monitored port in the old → new port map.
  3. Old-API jobs (package org.apache.hadoop.mapred) still run, but should be reviewed.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 2IntermediateStorage · Hadoop 3

How much disk does erasure coding free up?

Problem statement

A cluster stores 1.2 PB of business data, all with 3× replication. The team moves the 70% that is older than a year to the RS-6-3 erasure-coding policy. How much raw storage is freed, and how many 144 TB nodes is that?

Input
1.2 PB · 70% cold · 3× → 1.5× · 144 TB per node
Expected output
Before: 3600 TB raw, after: 2340 TB raw
Freed: 1260 TB = about 8 nodes

Approach

  1. Before: 1,200 TB × 3.
  2. After: hot 30% × 3 + cold 70% × 1.5.
  3. Freed raw TB ÷ 144 = nodes no longer needed.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 3AdvancedHigh availability · design

How many NameNodes and JournalNodes for a given safety level?

Problem statement

JournalNodes work by majority: with J JournalNodes the cluster tolerates (J − 1) ÷ 2 JournalNode failures. With N NameNodes (one active), it tolerates N − 1 NameNode failures. For each target, print the smallest setup that survives that many failures of each kind.

Input
targets: survive 1 failure (Hadoop 2 style) and 2 failures (Hadoop 3 style)
Expected output
Survive 1: 2 NameNodes + 3 JournalNodes (Hadoop 2 or 3)
Survive 2: 3 NameNodes + 5 JournalNodes (Hadoop 3 only)

Approach

  1. NameNodes needed = failures + 1.
  2. JournalNodes needed = 2 × failures + 1 (an odd number, for a majority).
  3. Hadoop 2 allowed at most 2 NameNodes; Hadoop 3 allows more.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

9 Quiz and revision

Check yourself

Quick revision

Lesson 2.4 in one screen

  • Hadoop 1 (2011): JobTracker + TaskTrackers, fixed map/reduce slots, MapReduce only, single NameNode, ~4,000 nodes.
  • Hadoop 2 (GA Oct 2013): YARN = ResourceManager + NodeManagers + one ApplicationMaster per job; containers.
  • Hadoop 2 also: NameNode HA (active + standby, JournalNodes, ZooKeeper failover), Federation, 128 MB blocks.
  • Many engines on one cluster: MapReduce, Spark, Tez, Flink.
  • Hadoop 3 (GA Dec 2017): erasure coding (RS-6-3 ≈ 1.5×), 2+ standby NameNodes, Java 8+, new ports.
  • Hadoop 3 YARN: Timeline v2, opportunistic containers, GPUs/FPGAs (3.1), Docker; Router-based Federation.
  • Ports: NameNode UI 50070 → 9870; DataNode 50010 → 9866, 50075 → 9864; Secondary 50090 → 9868; RM UI 8088 unchanged.
  • Recent: 3.3 (2020, Java 11 runtime, ARM), 3.4.0 (2024), 3.5.0 (Apr 2026, servers need JDK 17).

Interview and viva questions

What are the differences between Hadoop 1 and Hadoop 2?

Hadoop 1 used a single JobTracker for both resource management and job scheduling, with TaskTrackers offering fixed map and reduce slots, ran only MapReduce, had a single NameNode (a SPOF) and scaled to about 4,000 nodes. Hadoop 2 introduced YARN: a ResourceManager for cluster resources, NodeManagers on each node, and an ApplicationMaster per job, using flexible containers. It supports engines beyond MapReduce, adds NameNode High Availability and HDFS Federation, scales further and uses a 128 MB default block size.

What new features came in Hadoop 3?

HDFS erasure coding (about 1.5× storage overhead instead of 3× for suitable data), support for more than two NameNodes, a minimum of Java 8, default ports moved out of the ephemeral range (NameNode UI on 9870), a rewritten shell, YARN Timeline Service v2, opportunistic containers, resource types such as GPUs and FPGAs (3.1), Docker container support, Router-based Federation, an intra-DataNode disk balancer and much improved cloud storage connectors.

Why was the JobTracker a bottleneck?

It received heartbeats from every TaskTracker, scheduled every task of every job, tracked their progress and counters, and kept job history in memory. As clusters and job counts grew, one process could not keep up, and if it failed all running jobs were lost.

Is the Secondary NameNode a backup NameNode?

No. It periodically merges the NameNode's edit log into the fsimage (checkpointing) so the edit log does not grow forever and restarts are faster. It cannot take over if the NameNode fails. Automatic failover requires HA with a standby NameNode.

What is the difference between replication and erasure coding?

Replication stores full copies of each block (3× storage) and reads are simple and fast. Erasure coding splits data into data cells and computes parity cells (for example 6 + 3); any 6 of the 9 cells can rebuild the data. It needs about 1.5× storage but costs CPU and network to encode and rebuild, so it is best for cold, large files.

Practice problems

Questions that test version knowledge with small programs: slots, ports, storage schemes and HA sizing.

P1Easy

Total slots in Hadoop 1

A Hadoop 1 cluster has 50 nodes with 6 map and 3 reduce slots each. How many map and reduce slots in total?

Input
50 nodes · 6 map + 3 reduce
Expected output
map: 300 | reduce: 150
Show solution and explanation
print("map:", 50 * 6, "| reduce:", 50 * 3)
map: 300 | reduce: 150

How it works: 300 map and 150 reduce slots. If no reduce tasks are running, those 150 slots do nothing.

P2Easy

Erasure coding overhead

Print the storage overhead of RS-6-3 and RS-3-2 erasure coding.

Input
RS-6-3 · RS-3-2
Expected output
RS-6-3: 1.50x
RS-3-2: 1.67x
Show solution and explanation
for d, p in [(6, 3), (3, 2)]:
    print(f"RS-{d}-{p}: {(d + p) / d:.2f}x")
RS-6-3: 1.50x RS-3-2: 1.67x

How it works: 1.50× and 1.67×. Both are well below the 3× of replication; RS-6-3 is the default policy.

P3Easy

Port lookup

Write code that prints the Hadoop 3 port for the NameNode web UI, given a dictionary of services.

Input
{"namenode-ui": 9870, "rm-ui": 8088, "datanode-ui": 9864}
Expected output
Open http://localhost:9870
Show solution and explanation
ports = {"namenode-ui": 9870, "rm-ui": 8088, "datanode-ui": 9864}
print("Open http://localhost:" + str(ports["namenode-ui"]))
Open http://localhost:9870

How it works: On a fresh Hadoop 3 install, the NameNode UI is at http://localhost:9870 and YARN at http://localhost:8088.

P4Medium

Idle slots during a map phase

A Hadoop 1 cluster has 400 map slots and 200 reduce slots. 1,000 maps are waiting and no reduces. What percentage of all slots is idle? What would it be with 600 general containers?

Input
400 map + 200 reduce slots · 1000 maps waiting
Expected output
Hadoop 1 idle: 33%
Hadoop 2 idle: 0%
Show solution and explanation
total = 400 + 200
used_h1 = min(1000, 400)
used_h2 = min(1000, total)
print(f"Hadoop 1 idle: {(total - used_h1) / total:.0%}")
print(f"Hadoop 2 idle: {(total - used_h2) / total:.0%}")
Hadoop 1 idle: 33% Hadoop 2 idle: 0%

How it works: A third of the cluster idles in Hadoop 1 while maps queue up; YARN uses it all.

P5Medium

Survivable JournalNode failures

For 3, 4, 5 and 7 JournalNodes, print how many failures a majority-based system survives.

Input
[3, 4, 5, 7]
Expected output
3 JournalNodes survive 1 failure(s)
4 JournalNodes survive 1 failure(s)
5 JournalNodes survive 2 failure(s)
7 JournalNodes survive 3 failure(s)
Show solution and explanation
for j in [3, 4, 5, 7]:
    print(j, "JournalNodes survive", (j - 1) // 2, "failure(s)")
3 JournalNodes survive 1 failure(s) 4 JournalNodes survive 1 failure(s) 5 JournalNodes survive 2 failure(s) 7 JournalNodes survive 3 failure(s)

How it works: 3 → 1, 4 → 1, 5 → 2, 7 → 3. Even numbers add cost but no extra safety, which is why JournalNodes come in odd numbers.

P6Medium

Map features to versions

Given a list of features, print the ones that would NOT exist on a Hadoop 2 cluster.

Input
["YARN", "erasure coding", "NameNode HA", "GPU scheduling", "Federation"]
Expected output
['erasure coding', 'GPU scheduling']
Show solution and explanation
hadoop3_only = {"erasure coding", "GPU scheduling", "multiple standby NameNodes"}
features = ["YARN", "erasure coding", "NameNode HA", "GPU scheduling", "Federation"]
print([f for f in features if f in hadoop3_only])
['erasure coding', 'GPU scheduling']

How it works: Erasure coding and GPU scheduling need Hadoop 3. YARN, HA and Federation arrived in Hadoop 2.

P7Business problem

Should we upgrade to Hadoop 3 for storage savings?

A 2 PB cluster (raw) is full. 60% of the stored data is cold. Switching cold data from 3× replication to 1.5× erasure coding frees raw disk. The alternative is buying new nodes of 144 TB at Rs 18 lakh each. How much hardware spending does the upgrade avoid?

Input
2,048 TB raw · 60% cold · node 144 TB = Rs 18 lakh
Expected output
Freed 614 TB raw = 4 nodes = Rs 72 lakh avoided
Show solution and explanation
import math
raw = 2048
data = raw / 3
cold = data * 0.60
freed = cold * 3 - cold * 1.5
nodes = math.floor(freed / 144)
print(f"Freed {freed:.0f} TB raw = {nodes} nodes = Rs {nodes * 18} lakh avoided")
Freed 614 TB raw = 4 nodes = Rs 72 lakh avoided

How it works: About 614 TB freed, 4 nodes (Rs 72 lakh) not bought, using illustrative prices. Weigh it against upgrade effort and the CPU cost of erasure coding.

P8Business problem

Consolidate separate MapReduce and Spark clusters

A company runs a 40-node Hadoop 1 cluster for MapReduce and a separate 30-node cluster for Spark. Peak usage is 30 nodes and 20 nodes, at different times of day. With one YARN cluster, the worst-case need is the larger peak plus a quiet share of 6 nodes from the other, plus 20% spare. How many nodes are needed?

Input
peaks 30 and 20 at different times · quiet share 6 · +20%
Expected output
Nodes needed: 44 instead of 70
Show solution and explanation
import math
need = max(30, 20) + 6
print("Nodes needed:", math.ceil(need * 1.2), "instead of", 40 + 30)
Nodes needed: 44 instead of 70

How it works: 44 instead of 70 nodes. Sharing one cluster across engines was a major business reason for YARN.

Real-world scenario questions (asked in company interviews)

Version questions show up in almost every Hadoop interview. These scenarios turn the comparison table into practical answers.

Any company · conceptsFresher

“Explain the difference between Hadoop 1 and 2 in two minutes.”

The classic question. The interviewer wants the main differences and the reason behind them.

The interviewer is checking: do you know why YARN exists, not just its name?

Show a strong answer
  • Problem: in Hadoop 1, one JobTracker did resource management and scheduled every task of every job. It limited clusters to about 4,000 nodes, was a single point of failure, used fixed map/reduce slots (wasting capacity) and could only run MapReduce.
  • Fix (Hadoop 2): YARN split it: the ResourceManager manages resources; each job has its own ApplicationMaster; NodeManagers run flexible containers. Result: bigger clusters, better utilisation, and Spark, Tez and others on the same cluster.
  • Also in Hadoop 2: NameNode HA (active + standby) and Federation.

Avoid: saying “Hadoop 2 removed MapReduce”. MapReduce still exists; it runs as a YARN application.

Operations · troubleshootingFresher

“The NameNode web page won't open”

A colleague installed Hadoop 3.4 from a tutorial and says HDFS is running, but http://localhost:50070 shows “connection refused”.

The interviewer is checking: do you know the practical version differences?

Show a strong answer
  • Hadoop 3 moved the NameNode UI to 9870. Try http://localhost:9870.
  • Confirm with jps that the NameNode process is running, and check dfs.namenode.http-address in hdfs-site.xml.
  • The tutorial was probably written for Hadoop 2: double-check its other settings too (Java version, script names, ports for DataNodes).

Avoid: reinstalling Hadoop before checking the port.

Platform team · upgrade1–3 years

Plan an upgrade from Hadoop 2.10 to 3.x

Your company runs a 60-node Hadoop 2.10 cluster with Hive and Spark jobs. Management wants it on a current 3.x release with minimal downtime.

The interviewer is checking: can you think through compatibility and risk, not just “install the new version”?

Show a strong answer
  1. Inventory: Java version, every job and its libraries (Hive, Spark, custom jars), scripts using old shell behaviour, monitoring and firewalls using old ports.
  2. Compatibility: pick a 3.x release supported by your Hive and Spark versions; upgrade Java first.
  3. Staging: build a staging cluster on the target version and run real jobs on copies of data.
  4. Upgrade: back up NameNode metadata, use an HA rolling upgrade for HDFS where supported, then YARN, keeping a rollback path until finalised.
  5. After: update ports in monitoring, then consider Hadoop 3 features like erasure coding for cold data.

Avoid: upgrading production directly, or enabling erasure coding everywhere on day one.

Banking · availability3+ years

Two NameNodes or three?

A bank's HDFS cluster uses HA with two NameNodes. Last month, while the standby was down for patching, the active NameNode's server failed, and HDFS was unavailable for an hour.

The interviewer is checking: do you know what Hadoop 3 added for availability and how quorums work?

Show a strong answer
  • With two NameNodes, maintenance on one leaves no protection. Hadoop 3 supports more than two NameNodes: with one active and two standbys, one can be patched while another still protects the cluster.
  • Pair it with five JournalNodes (a majority of 3 must be alive) to tolerate two JournalNode failures as well.
  • Run the NameNodes on different racks and power feeds, and schedule maintenance one node at a time.

Avoid: “Use the Secondary NameNode as a third backup.” It cannot take over.