YARN Questions with Answers

9 practice questions on YARN (Big Data (Hadoop & Spark)) with answers and step-by-step solutions. Try 9 samples below, then practise all 9 free in the AptiNest app.

Sample questions

Question 1Easy

A YARN container is

  1. A bundle of resources such as memory and CPU cores on a node
  2. A Docker image only containing an application and all of its libraries
  3. An HDFS block
  4. A replica of the NameNode

Answer: A. A bundle of resources such as memory and CPU cores on a node

Explanation

Tasks run inside containers whose size is requested from the ResourceManager.

Step-by-step solution

  1. Request memory and cores.
  2. RM grants a container.
  3. Task runs inside it.

Why the other options are wrong

  • B. YARN containers are resource allocations.
  • C. Blocks are storage units.
  • D. Not related.

Question 2Easy

YARN stands for

  1. Yearly Apache Resource Node
  2. Yet Another Resource Negotiator
  3. Yet Another Replication Network
  4. Your Application Runtime Node

Answer: B. Yet Another Resource Negotiator

Explanation

YARN manages cluster resources and schedules applications in Hadoop 2 and later.

Step-by-step solution

  1. Resource management layer.
  2. Separates scheduling from processing.
  3. Runs many frameworks.

Why the other options are wrong

  • A. Not the name.
  • C. Not the name.
  • D. Not the name.

Question 3Easy

In Hadoop 2 and later, which component manages cluster resources and allocates containers?

  1. HDFS
  2. YARN
  3. Hive
  4. Oozie

Answer: B. YARN

Explanation

YARN separates resource management from processing frameworks like MapReduce and Spark.

Step-by-step solution

  1. In Hadoop 2 and later, YARN is the cluster resource manager.
  2. It separates resource management from the processing frameworks.
  3. It allocates containers, which are slices of cluster resources, to applications.
  4. So the component is YARN (option B).

Why the other options are wrong

  • A. HDFS is the storage layer and does not allocate containers.
  • C. Hive is a SQL-style query layer, not a resource manager.
  • D. Oozie is a workflow scheduler for jobs, not the cluster resource manager.

Tip: Hadoop 2 split the roles: HDFS stores data, YARN manages resources, the processing framework computes.

Question 4Easy

In YARN, which component allocates cluster resources among applications?

  1. NameNode, the master daemon that runs on each worker node
  2. NodeManager
  3. ResourceManager
  4. DataNode

Answer: C. ResourceManager

Explanation

The ResourceManager schedules containers; NodeManagers launch and monitor them on each node.

Step-by-step solution

  1. ResourceManager: global.
  2. NodeManager: per node.
  3. ApplicationMaster: per app.

Why the other options are wrong

  • A. The NameNode manages HDFS metadata.
  • B. It manages resources on a single node.
  • D. It stores HDFS blocks.

Question 5Medium

What problem in Hadoop 1 did YARN solve?

  1. HDFS replication was too high because the ResourceManager could not schedule any containers
  2. There was no storage layer
  3. MapReduce was removed
  4. The JobTracker was a single bottleneck for both scheduling and job tracking

Answer: D. The JobTracker was a single bottleneck for both scheduling and job tracking

Explanation

YARN splits resource management and per-application coordination so more frameworks, such as Spark, can run on the cluster.

Step-by-step solution

  1. JobTracker did everything.
  2. YARN separates concerns.
  3. Supports many frameworks.

Why the other options are wrong

  • A. Unrelated.
  • B. HDFS existed already.
  • C. MapReduce still runs on YARN.

Question 6Medium

In YARN, which daemon runs on each worker node and manages containers there?

  1. NodeManager
  2. ResourceManager
  3. NameNode
  4. ApplicationMaster

Answer: A. NodeManager

Explanation

NodeManager launches and monitors containers; ResourceManager is the cluster-level arbiter.

Step-by-step solution

  1. YARN has one ResourceManager for the whole cluster.
  2. Each worker node runs its own NodeManager.
  3. The NodeManager launches and monitors the containers on its own node.
  4. So the per-node daemon is the NodeManager (option A).

Why the other options are wrong

  • B. ResourceManager is the cluster-level arbiter, not a per-node daemon.
  • C. NameNode holds HDFS metadata, not YARN containers.
  • D. ApplicationMaster runs per application and coordinates one job's tasks.

Tip: Per node = NodeManager, per cluster = ResourceManager, per application = ApplicationMaster.

Question 7Medium

What is the role of the ApplicationMaster in YARN?

  1. Stores metadata for all HDFS files by default by default
  2. Manages resources for the entire cluster on each node on each node
  3. Replicates blocks between nodes
  4. Negotiates resources for one application and coordinates its tasks

Answer: D. Negotiates resources for one application and coordinates its tasks

Explanation

There is one ApplicationMaster per application; it requests containers from the ResourceManager.

Step-by-step solution

  1. The ApplicationMaster is started for one application.
  2. It asks the ResourceManager for containers for that application.
  3. It then coordinates that application's tasks inside those containers.
  4. So the role is option D: negotiate resources for one application and coordinate its tasks.

Why the other options are wrong

  • A. Storing metadata for HDFS files is the NameNode's job, not the ApplicationMaster's.
  • B. Cluster-wide resource management is the ResourceManager's job; the ApplicationMaster serves one application.
  • C. Replicating blocks is done by HDFS, not by the ApplicationMaster.

Tip: Remember: one ApplicationMaster per application, and it talks to the ResourceManager for containers.

Question 8Medium

The ApplicationMaster in YARN

  1. Manages all applications in the cluster, deciding which jobs may start and where
  2. Stores HDFS blocks
  3. Authenticates all users
  4. Negotiates containers for one application and tracks its tasks

Answer: D. Negotiates containers for one application and tracks its tasks

Explanation

Each application has its own ApplicationMaster running in a container.

Step-by-step solution

  1. One AM per application.
  2. Asks RM for containers.
  3. Monitors task progress.

Why the other options are wrong

  • A. That is the ResourceManager.
  • B. DataNodes do that.
  • C. Not its task.

Question 9Hard

YARN has a total of 100 GB memory. Each container needs 4 GB, and 1 container is used by the ApplicationMaster. How many task containers can run at once?

  1. 25
  2. 100
  3. 24
  4. 26

Answer: C. 24

Explanation

100/4 = 25 containers; one is the AM, leaving 24 for tasks.

Step-by-step solution

  1. Total containers = 100/4 = 25.
  2. Minus 1 for the AM.
  3. = 24.

Why the other options are wrong

  • A. Ignores the container used by the ApplicationMaster.
  • B. Treats memory in GB as container count.
  • D. Adds one instead of subtracting.

Practise all 9 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Big Data (Hadoop & Spark) topics · All topics