How to Use This Lesson
Read each question, answer it aloud in your own words, then compare. Short, clear answers with an example impress interviewers more than long definitions.
HDFS Questions
1. What does the NameNode store, and what does it not store?
It stores the namespace (directories, files, permissions) and the mapping of files to blocks, in memory, with fsimage and edits on disk. It does not store block data and it does not save block locations persistently. Locations are rebuilt from DataNode block reports.
2. What is the default block size and replication factor?
128 MB and 3 replicas. Larger blocks reduce NameNode metadata and suit large sequential reads.
3. How does HDFS place the 3 replicas?
First on the writer's node (or a random node), second on a node in a different rack, third on another node in the same rack as the second. This balances fault tolerance and network cost. It needs a topology script for rack awareness.
4. What happens when a DataNode fails?
Heartbeats stop. After about 10.5 minutes with defaults the NameNode marks it dead and re-replicates its blocks to other nodes to restore the replication factor.
5. What is safe mode?
A read-only state at NameNode startup (or entered manually) while it waits for enough blocks to be reported. It leaves automatically when the threshold (default 99.9 percent of blocks) is reached.
6. Difference between Secondary NameNode and Standby NameNode?
The Secondary NameNode only performs checkpoints (merges edits into fsimage); it cannot take over. The Standby NameNode in HA keeps up-to-date state through JournalNodes, does checkpoints and can become active in seconds.
7. How do you check the health of HDFS?
8. What is the small files problem?
Every file and block uses NameNode heap, so millions of tiny files exhaust memory and slow RPC. Fixes: compaction, larger files with container formats, archiving, name quotas and user education.
9. How do you add and remove a DataNode?
Add: configure, start, add to workers, run the balancer. Remove: add to the exclude file, hdfs dfsadmin -refreshNodes, wait for Decommissioned, then stop.
10. What does the balancer do?
It moves blocks from over-used DataNodes to under-used ones until usage is within a threshold. It uses limited bandwidth (-setBalancerBandwidth) so it does not hurt production.
YARN Questions
11. Explain YARN architecture.
ResourceManager (Scheduler + ApplicationsManager) manages cluster resources. NodeManager on each node launches and monitors containers. Per application, an ApplicationMaster negotiates containers and runs tasks.
12. Capacity vs Fair scheduler?
Capacity Scheduler gives each queue a guaranteed share with elastic limits and ACLs, suited to multi-tenant enterprises. Fair Scheduler tries to give all running apps an equal share over time through weights and pools.
13. What are the main YARN memory properties?
| Property | Meaning |
|---|---|
yarn.nodemanager.resource.memory-mb | Memory offered per node |
yarn.scheduler.minimum/maximum-allocation-mb | Container size bounds |
mapreduce.map.memory.mb, ...java.opts | Container size and heap for map tasks |
14. A job is stuck in ACCEPTED. What do you check?
Queue capacity and limits, AM resource percentage, healthy NodeManagers, container request versus max allocation, ACLs and node labels.
15. How do you see logs of a finished application?
yarn logs -applicationId <id>, which works when log aggregation is enabled. Also the JobHistory or Spark History Server.
Configuration and Operations Questions
| Question | Short answer |
|---|---|
| 16. Which files configure Hadoop? | core-site.xml, hdfs-site.xml, yarn-site.xml, mapred-site.xml, hadoop-env.sh, workers, capacity-scheduler.xml, log4j config |
| 17. NameNode and ResourceManager web ports in Hadoop 3? | NameNode 9870 (HTTPS 9871), ResourceManager 8088, DataNode 9864, NodeManager 8042, JobHistory 19888 |
| 18. How do you start HDFS daemons? | hdfs --daemon start namenode|datanode, or start-dfs.sh, or systemd units |
| 19. How do you change the replication of existing data? | hdfs dfs -setrep -w 2 /path |
20. What is the difference between hdfs dfs -rm and -skipTrash? | Without it the file moves to .Trash (if enabled) and can be restored; with it, deletion is permanent |
21. What does hdfs dfsadmin -refreshNodes do? | Makes the NameNode re-read include/exclude files for decommissioning |
| 22. What is a snapshot? | A read-only point-in-time view of a directory, space efficient, used against accidental deletes |
| 23. What is distcp? | A MapReduce-based tool for large parallel copies within or between clusters |
| 24. Why NTP/chrony matters? | Kerberos tolerates only a small time skew; logs and HA also rely on correct time |
| 25. What Linux settings do you tune for Hadoop? | ulimit -n, vm.swappiness=1, THP off, noatime mounts, network buffers |
Quick Self-Test
- Can you draw HDFS read and write flow on a whiteboard?
- Can you list the steps to decommission a node and explain why each is needed?
- Can you explain the difference between a block, a replica and a file?
- Can you name three reasons a job stays in ACCEPTED?
Conclusion
Know the roles of NameNode, DataNode, ResourceManager and NodeManager, default values, health commands, decommission steps, scheduler basics and the small files problem. Practise answering aloud.

