New · Cohort 3Engineering Analytics Cohort 3 goes live 25 July — only 30 seatsRegister Now
Interview Questions — Hadoop

Hadoop Interview Questions 2026: HDFS, MapReduce, YARN & Migration-Era Answers

Sixteen interviewer-grade Hadoop questions with complete answers — HDFS internals, MapReduce, YARN, the small-files problem, and the migration questions that now decide senior rounds. Written for Indian data engineering interviews in 2026.

By Durgesh Yadav — Senior Data Engineer @ 7-Eleven · Updated 2026-07-25. Preparation guidance, not a hiring guarantee.

What are the most common Hadoop interview questions?

Hadoop interviews focus on HDFS architecture (NameNode, DataNode, blocks, replication), the MapReduce execution flow, YARN resource management, the small-files problem, and Hadoop versus Spark. In 2026, expect migration questions too — moving workloads from HDFS to cloud object storage. Strong answers explain the why behind each design decision, not just definitions.

Guide

What To Learn And How To Practice

What Hadoop interviewers actually test

In 2026 few teams write new MapReduce code, so Hadoop questions are rarely about API syntax. Interviewers use Hadoop as a proxy for distributed-systems fundamentals: do you understand why data is replicated, why computation moves to data, what a shuffle costs, and how a master-worker architecture scales and fails. A candidate who can explain why the NameNode keeps metadata in RAM, or why a combiner cannot be relied on to run, demonstrates reasoning that transfers directly to Spark, Kafka, and cloud warehouses. At services companies and GCCs that still operate large on-prem clusters, expect operational questions too — small files, failed DataNodes, slow jobs. For experienced roles, migration questions are now standard: what breaks when HDFS data moves to object storage. Definitions get you past the first minute; the why behind each design decision gets you the offer.

Fundamentals over API trivia — replication, shuffle, locality
Operational scenarios: small files, dead DataNodes, slow jobs
Migration and modernization questions for 2-6 yr roles
The 'why' behind each design choice, not the definition

How to prepare in one focused week

Structure beats volume. Days one and two: HDFS — draw the read path and the write pipeline from memory, including the NameNode's role and what happens when a DataNode dies mid-write. Day three: the MapReduce flow end to end — buffer, spill, partition, sort, combiner, shuffle, merge — because this is where interviewers probe depth. Day four: YARN's three-way split of ResourceManager, NodeManager, and ApplicationMaster, plus how Spark runs on it. Day five: the comparison layer — MapReduce versus Spark, replication versus erasure coding, HDFS versus object storage. Spend the last days on scenario practice: answer 'production has ten million small files, what do you do' out loud, leading with the NameNode-memory root cause. If you can, run one job on a single-node Docker setup and inspect the counters — shuffle bytes and spilled records make the theory concrete.

Draw HDFS read/write paths until you can do it cold
Rehearse the MapReduce spill-shuffle-merge sequence verbally
Practice scenario answers, not just definitions
Run one job locally and read its counters

Common mistakes that cost offers

The most frequent failure is answering 'Spark is faster because it is in-memory' and stopping — that one-liner is where the interviewer's real question begins. Second: calling the Secondary NameNode a backup; it is a checkpointing helper, and getting this wrong signals surface-level prep. Third: claiming map output is written to HDFS — it goes to local disk, and the distinction matters because it explains why shuffle is expensive but not replicated. Fourth: treating the small-files problem as 'just use bigger files' without naming the NameNode heap as the root cause. Fifth: reciting Hadoop 1 architecture — JobTracker and TaskTracker — as if it were current; lead with YARN and mention the old design only as history. Finally, don't invent experience: if you have not run a production cluster or a migration, say so and reason from first principles. Interviewers respect that far more than a fabricated war story.

'In-memory' is the start of the Spark answer, not the end
Secondary NameNode is not a standby — the classic trap
Map output lands on local disk, not HDFS
Never fabricate cluster or migration experience

Where Hadoop sits in 2026 — and why it is still asked

Hadoop in 2026 is legacy infrastructure with a long tail, not a growth technology — and interviewers know it. New platforms are built on cloud object storage with Spark, Trino, or warehouse engines on top. But large on-prem HDFS estates persist in banks, telecoms, and the services companies and GCCs that maintain them, and someone has to run, tune, and migrate those clusters. That creates two interview modes. Maintenance-mode questions test whether you can operate what exists: NameNode memory pressure, small files, failed nodes, YARN queue tuning. Migration-mode questions test whether you can move it: DistCp strategies, committer problems on object storage, rewriting hdfs:// references, and re-platforming Hive tables onto Iceberg or Delta. Frame your Hadoop knowledge accordingly — as distributed-systems literacy plus modernization readiness, not as enthusiasm for the stack itself. That framing matches exactly what hiring managers running these projects need.

Legacy estates persist at banks, telecoms, services firms, GCCs
Two question modes: operate the cluster, or migrate it
Concepts transfer to Spark, Kafka, and cloud warehouses
Position yourself as modernization-ready, not stack-nostalgic

Question bank

16 interview questions with answers

Real questions from beginner to advanced, each with a concise model answer — practice them, then rehearse live in a mock interview.

EasyWhat is Hadoop and what are its core components?

Hadoop is an open-source framework for storing and processing very large datasets across clusters of commodity machines. It has three core components plus a support layer: HDFS, the distributed file system that splits files into large blocks and replicates them across nodes; YARN, the resource manager that allocates CPU and memory to applications; and MapReduce, the original batch processing model. Hadoop Common provides shared libraries and utilities. Two design ideas matter more than the component list: computation moves to where the data lives instead of pulling data across the network, and failure is handled in software — replicated blocks and re-run tasks — because commodity hardware is expected to fail. A good answer also notes that the wider ecosystem (Hive, HBase, Spark on YARN) sits on top of these primitives.

EasyWhat are the roles of the NameNode and DataNodes in HDFS?

The NameNode is the master that stores the filesystem namespace: the directory tree, file permissions, and the mapping of each file to its blocks. It keeps this metadata in RAM for fast access, persisting it as an fsimage plus an edit log. Block locations are not persisted — they are rebuilt at startup from block reports sent by DataNodes. DataNodes are the workers: they store actual block data on local disks, serve read and write requests, and send heartbeats and block reports to the NameNode. Crucially, the NameNode is not in the data path — a client asks it for block locations, then streams data directly to or from DataNodes. That is why one modest master can coordinate petabytes. In Hadoop 1 the NameNode was a single point of failure; Hadoop 2+ added high availability with a standby.

EasyWhy is the HDFS block size so large (128 MB by default)?

The default block size is 128 MB (64 MB in very old Hadoop 1 clusters), enormous compared with disk filesystems. Three reasons. First, seek overhead: with large sequential blocks, time spent seeking is tiny relative to transfer time, so throughput approaches disk bandwidth. Second, NameNode memory: every block consumes roughly 150 bytes of metadata in the NameNode heap, so fewer, bigger blocks let a single master track petabytes. Third, scheduling: one map task typically processes one block, and larger blocks mean fewer tasks and less startup overhead per job. There is a ceiling — blocks that are too large reduce parallelism because fewer tasks can run concurrently. One detail interviewers like: a file smaller than the block size occupies only its actual size on disk. The block is a logical unit, not preallocated space.

EasyWhat is the replication factor in HDFS and why is the default 3?

Replication factor is the number of copies HDFS keeps of each block; the default is 3. When a client writes a block, it is pipelined to three DataNodes, so the cluster can lose a node — or, with rack-aware placement, an entire rack — without losing data. The NameNode continuously compares expected versus reported replicas; if a DataNode dies, under-replicated blocks are re-copied from surviving replicas automatically, with no operator action. Replication also helps reads: clients fetch from the nearest replica, and popular data has more sources. The cost is 3x storage overhead, which is why Hadoop 3 introduced erasure coding as an alternative for cold data at roughly 1.5x. Replication is set per file, not just per cluster, so teams often keep hot datasets at 3 and archives lower or erasure-coded.

EasyWhat is YARN and why was it introduced in Hadoop 2?

YARN (Yet Another Resource Negotiator) is Hadoop's cluster resource management layer, introduced in Hadoop 2. Hadoop 1's JobTracker did two jobs at once — scheduling cluster resources and tracking every MapReduce task — which limited scale and locked the cluster to a single processing model. YARN split those roles. The ResourceManager is the global authority: its scheduler (Capacity or Fair) hands out containers, and its ApplicationsManager accepts job submissions. Each node runs a NodeManager that launches and monitors containers locally. Every application gets its own ApplicationMaster, a small process that negotiates containers and drives execution for that one job. The consequences: cluster scale improved because per-job bookkeeping moved out of the central daemon, and the cluster became engine-agnostic — MapReduce, Spark, Tez, and Hive can all share the same hardware under one scheduler.

MediumWalk through the complete MapReduce execution flow.

Start from input: the InputFormat computes splits (usually one per HDFS block) and a RecordReader turns bytes into key-value pairs. The map function processes each record and writes output to an in-memory circular buffer (100 MB by default). When the buffer passes a threshold (around 80%), a background thread spills it to local disk — during the spill, records are partitioned by reducer and sorted by key, and the optional combiner runs. Spill files are merged into one partitioned, sorted file per map task. Note this lands on local disk, not HDFS. In the shuffle phase, each reducer pulls its partition from every completed map task over HTTP, merges the sorted streams, and calls reduce once per key with all its values. Finally, the OutputFormat writes results to HDFS. Interviewers listen for three checkpoints: where sorting happens, where the combiner runs, and that map output never touches HDFS.

MediumWhat is the small-files problem in HDFS and how do you fix it?

HDFS is built for a modest number of huge files, and the NameNode keeps an object in heap memory for every file, directory, and block — roughly 150 bytes each. Ten million small files means tens of millions of objects, and NameNode heap becomes the cluster's scaling wall long before disk does. Processing suffers too: each small file typically becomes its own split, so a job over a million 1 MB files launches a million short-lived tasks dominated by startup overhead. Fixes, in order of preference: stop the problem at ingestion by batching writes into larger files; run scheduled compaction jobs that rewrite small files into large ORC, Parquet, or Avro files; use CombineFileInputFormat so one task reads many files; pack legacy data into HAR archives or SequenceFiles; and for genuinely small records, use HBase rather than raw HDFS files. In interviews, lead with the NameNode-memory root cause, not just the fix list.

MediumHow does HDFS detect and handle a DataNode failure?

Every DataNode sends a heartbeat to the NameNode every 3 seconds. If heartbeats stop, the node is first treated as stale (reads and writes deprioritize it), and after roughly 10 minutes — derived from the recheck-interval settings — it is declared dead. The NameNode then walks the list of blocks that node held and schedules re-replication: healthy replicas are copied to other DataNodes until every block is back at its target replication factor, throttled so recovery traffic does not starve real work. The long timeout is deliberate: re-replicating an entire node's data is expensive, so HDFS avoids reacting to short network blips. Corruption is handled separately: clients verify checksums on every read, and a corrupt replica is reported, discarded, and replaced from a good copy. The takeaway an interviewer wants: failure handling is automatic, replica-driven, and the NameNode orchestrates but never carries the data itself.

MediumWhat is rack awareness and how does the default replica placement policy work?

Rack awareness means the NameNode knows which rack each DataNode belongs to, via a configured topology script or class. The default placement policy for replication factor 3: the first replica goes on the writer's own DataNode (or a random node if the client is outside the cluster); the second goes to a node on a different rack; the third goes to a different node on the same rack as the second. The reasoning is a bandwidth-versus-safety compromise. Losing a whole rack — a top-of-rack switch failure is the classic case — still leaves a live replica, because two racks always hold the data. But the write pipeline crosses the rack boundary only once (between replicas one and two), since replicas two and three are rack-local to each other. On reads, HDFS serves from the topologically closest replica. Mentioning the switch-failure scenario shows you understand why the policy exists.

MediumWhat are the combiner and partitioner in MapReduce, and when is a combiner unsafe?

The partitioner decides which reducer receives each map output key — the default HashPartitioner takes hash(key) mod the number of reducers. You write a custom one for things like total ordering or routing related keys together; it is also where key-skew problems surface. The combiner is a local mini-reduce that runs on map output before it is shuffled, shrinking data sent across the network — for a word count, a mapper that saw 'the' 10,000 times ships one pair instead of 10,000. The catch: the framework may run the combiner zero, one, or many times, so correctness must not depend on it running. That restricts combiners to commutative, associative operations — sum, count, min, max. The classic trap is average: averaging averages is wrong. The fix is to make the combiner emit (sum, count) pairs and let the reducer do the final division.

MediumIs the Secondary NameNode a backup for the NameNode? What does it actually do?

This is a deliberate trap: the Secondary NameNode is not a backup and cannot take over if the NameNode dies. Its job is checkpointing. The NameNode persists metadata as an fsimage snapshot plus an ever-growing edit log of changes; replaying a huge edit log makes restarts painfully slow. The Secondary NameNode periodically fetches both files, merges the edits into a new fsimage on its own hardware (which is why it needs comparable memory), and ships the result back. Metadata loss is still possible between checkpoints if the NameNode's disks are lost. Actual failover requires an HA deployment: an Active and a Standby NameNode sharing edits through a quorum of JournalNodes, with ZooKeeper Failover Controllers handling automatic failover and fencing preventing split-brain. In HA clusters the Standby performs checkpointing itself, so no Secondary NameNode runs at all. Stating that last fact cleanly usually ends the question.

MediumHow do Hadoop and Spark differ? Is Spark a replacement for Hadoop?

They sit at different layers, so 'versus' is partly a category error. Hadoop is a platform: HDFS for storage, YARN for resource management, MapReduce as its original compute engine. Spark is only a compute engine — and in most enterprises it runs on YARN, reading data from HDFS. The real comparison is MapReduce versus Spark. MapReduce materializes intermediate results to disk between every job, executes rigid map-then-reduce stages, and starts fresh JVMs per task. Spark builds a DAG of the whole computation, pipelines stages, keeps executors warm, and can cache datasets in memory — which transforms iterative workloads like ML and interactive queries. Spark also bundles SQL, streaming, and ML APIs. By 2026, essentially no one writes new MapReduce jobs, but Hadoop's storage and scheduling layers survive underneath Spark in many on-prem clusters. Saying 'Spark replaced MapReduce, not Hadoop' captures it precisely.

HardWhy exactly is Spark faster than MapReduce, and when does that advantage shrink?

The slogan answer — 'Spark is in-memory' — is incomplete. Spark's real advantages: it builds a DAG of the entire computation and pipelines operations within a stage, so intermediate results between chained jobs are not written to HDFS the way MapReduce requires; executors are long-lived JVMs that run many tasks, avoiding MapReduce's per-task JVM startup; explicit caching lets iterative algorithms reuse a dataset across passes; and Catalyst plus whole-stage code generation optimize SQL workloads. But the gap narrows in specific cases. Spark shuffles still write to local disk, and when a shuffle far exceeds cluster memory, Spark spills heavily and behaves much like MapReduce — with added GC and memory-management tuning burden. For a single-pass ETL job that reads once, transforms, and writes once, there is no intermediate data to keep in memory, so the win comes mainly from pipelining and JVM reuse, not caching. Demonstrating you know when the advantage shrinks is what makes this a senior answer.

HardDescribe the HDFS write pipeline in detail, including failure handling mid-write.

The client asks the NameNode to create the file and allocate a block; the NameNode returns a pipeline of DataNodes chosen by the placement policy — three for default replication. The client streams the block as small packets (around 64 KB), which flow through the pipeline: client to DN1, DN1 forwards to DN2, DN2 to DN3. Acks travel back up the pipeline, and the client keeps unacknowledged packets in an ack queue. If a DataNode fails mid-write, the pipeline is torn down, the failed node is removed, the block gets a new generation stamp on the surviving nodes so stale replicas are detectable, and writing resumes through the shorter pipeline; the NameNode restores full replication later. hflush guarantees data has reached every DataNode in the pipeline's memory; hsync forces it to disk. On close, the NameNode commits the file once minimum replication is acknowledged. This question separates people who read the architecture from people who memorized definitions.

HardCompare erasure coding in Hadoop 3 with 3x replication. When would you use each?

Erasure coding, added in Hadoop 3, cuts the storage cost of fault tolerance. With the common Reed-Solomon RS-6-3 policy, data is striped into six data cells plus three parity cells across nine DataNodes; any three can be lost and the data is still reconstructable. Overhead drops from 3x with replication to 1.5x — a massive saving on large clusters. The costs are real, though. Reconstruction after a failure requires reading from multiple surviving nodes and doing CPU-heavy decoding, versus simply copying one replica. The striped layout removes data locality, so tasks read remotely by design. Small files are handled poorly because striping needs enough data to fill cells. EC files also do not support append or hflush/hsync. The practical policy interviewers want: keep hot, frequently read data on 3x replication; move cold, archival data to erasure coding. It is a storage-economics decision, not a blanket upgrade.

HardWhat breaks when you migrate Hadoop workloads from HDFS to cloud object storage?

This is the question that distinguishes candidates in 2026, since many enterprises and GCCs are mid-migration. Object stores like S3, ADLS, and GCS are not filesystems, and several HDFS assumptions break. Rename is the big one: on HDFS it is an atomic metadata operation, but on object stores it is a copy-then-delete proportional to data size — so job-commit protocols that rename temporary output into place need replacements like the S3A committers or manifest committers. Directory listings are emulated and slow at scale, hurting listing-heavy jobs. Data locality disappears entirely — compute and storage are separated, which is a feature for elasticity but changes performance tuning. HDFS permissions and ACLs map awkwardly onto cloud IAM. Hardcoded hdfs:// URIs and Hive metastore locations need rewriting, and bulk transfer typically runs through DistCp. Mention that many teams pair the move with a table format like Iceberg, Delta, or Hudi to restore atomic commits.

FAQ

Common Questions

Is Hadoop still worth preparing for in 2026?

Yes, selectively. New platforms are rarely built on Hadoop, but banks, telecoms, services companies, and GCCs in India still run large HDFS and YARN estates, and job descriptions for those teams list Hadoop explicitly. Even where the stack is gone, interviewers reuse Hadoop questions to test distributed-systems fundamentals — replication, shuffle cost, master-worker failure handling — because the concepts transfer directly to Spark and cloud warehouses.

Do I need MapReduce if teams only use Spark now?

Learn the execution model, not the programming API. Almost nobody writes new MapReduce jobs, but the flow — split, map, spill, partition, sort, combine, shuffle, reduce — is the vocabulary interviewers use to test whether you understand what a distributed shuffle costs. That same model explains Spark stage boundaries and shuffle tuning. Skip writing Mapper classes; be fluent in the pipeline diagram and where data hits disk.

How deep should freshers go versus experienced candidates?

Freshers should nail the architecture layer: NameNode versus DataNode, block size and replication, the MapReduce flow, and what YARN does — with clear reasoning for each design choice. Candidates with two to six years should add operations and evolution: NameNode HA with JournalNodes and ZKFC, the small-files problem and its fixes, erasure coding trade-offs, and a working view of HDFS-to-object-storage migration issues.

What Hadoop 3 features are worth knowing for interviews?

Three come up repeatedly. Erasure coding, which cuts storage overhead from 3x to roughly 1.5x for cold data at the cost of reconstruction CPU and lost locality. Support for more than two NameNodes in an HA setup, giving multiple standbys. And the intra-DataNode disk balancer, which evens out data across disks within one node. Knowing why each exists — storage economics, availability, operational pain — matters more than the feature list.

How do I handle migration questions without real migration experience?

Say you have not done one, then reason from first principles — interviewers rate honesty plus reasoning above vague claims. Know the core breakages: rename is not atomic on object stores, so output committers change; data locality disappears; directory listings are slower; hdfs:// URIs and Hive table locations need rewriting; DistCp handles bulk transfer. Closing with how table formats like Iceberg or Delta restore atomic commits shows current awareness.

Next Step

Turn The Guide Into Practice

Use PrepNPlaced tools to turn this learning path into resume proof, targeted practice, and interview-ready explanations.

Practice AI Mock Interview