Yarn Interview Questions For Freshers & Experienced

  • Question 1) What is Yarn?
  • Question 2) What are the components of yarn?
  • Question 3) What is use of yarn in Hadoop?
  • Question 4) Enlist few difference between yarn and NPM?
  • Question 5) Explain Resource Manager In YARN?
  • Question 6) What is ApplicationMaster in YARN?
  • Question 7) How to add dev dependencies in yarn?
  • Question 8) What is yarn command?
  • Sharad Jaiswal
  • 22nd Dec, 2019
  • 643 Followers

Yarn Interview Questions
Updated ON

22nd Dec, 2019

No. of Questions

8

Posted In

Others

Author

Sharad Jaiswal

Key Features of Yarn

Below are few major features of Yarn

Global ResourceManager

Supports Multi-tenancy

Multiple resource types

Scalability and Compatibility

Docker containerization

Cluster utilization

Backed by Facebook Team

Supports variety of processing engines

NodeManager slave

Yarn Interview Questions

Q1. What is Yarn?

Yarn (Yet Another Resource Negotiator) is a type of package manager that replaces the existing workflow for the npm and other package managers but still remains compatible with the npm registry. Yarn also works as a project manager to create safe, stable, and reproducible projects.

This open-source JavaScript package manager is developed by Facebook. Your current npm workflow can be totally replaced by Yarn with minimal effort.

Q2. What are the components of yarn?

The components of Yarn are,

Resource manager

It is used to manage resources that are used across the cluster. It has two components namely Scheduler and Application manager. Scheduling of the resources based on the requirements of the application is done by the scheduler. The application manager manages the execution of the application master in the cluster.

Node manager

It is responsible for the execution of the task in each node.

Containers

These are the set of resources like RAM, CPU, and Memory present in the node. These resources are scheduled by the Resource manager and monitored by the Node manager.

Application Master

The application master monitors the execution of tasks and manages the lifecycle of the applications running on the cluster.

Q3. What is use of yarn in Hadoop?

In the Hadoop framework, Yarn is used for resource management and job scheduling. It allocates the system resources to various applications running in the Hadoop cluster. It also schedules the task that is to be executed on different clusters. The Yarn sits between the HDFS and the processing engine in the Hadoop architecture. It allocates the resource dynamically so it improves resource utilization and application performance.

Yarn uses scheduling methods that are based on the queue format for submitting the jobs.

Q4. Enlist few difference between yarn and NPM?

NPM (Node Package Manager) is a package manager for JavaScript. It presents a command-line interface to the npm system which the users can use to install different JavaScript packages to their application. It is considered as the best package manager by the JavaScript community.

Some of the companies that use the npm package manager are Reddit, Instacart, and Starbucks.

YARN (Yet Another Resource Negotiator) is a new package manager for JavaScript. Yarn caches every package it downloads. So the package need not be downloaded again. Yarn uses parallel operations so the resource utilization is maximized and the install times are faster. StackShare, Docplanner, and BrightMachine are some of the companies that use the YARN package manager.

Q5. Explain Resource Manager In YARN?

The resource manager is a core component in Yarn that manages the different resources among all applications. It arbitrates all the available resources and helps manage the distributed application run on the YARN system.

The two main components of the resource manager are the Scheduler and Application Manager.

The scheduler in the Resource manager is responsible for allocating resources. It schedules the resource-based on the resource requirement of the applications.

The application manager is responsible for accepting the job-submissions and execution of the application-specific application master.

Q6. What is ApplicationMaster in YARN?

The application master in the YARN is responsible for the execution of a single application. It gets the resource from the Resource Scheduler and executes the application. It is a framework-specific library that knows the application logic and executes the application scheduled by the Yarn scheduler.

Q7. How to add dev dependencies in yarn?

To add a dependency, you should use the command "yarn add {package-name}" specified by the package name of the required dependency. It installs the package and also updates the dependency in the package.json file and yarn.lock.

Q8. What is yarn command?

YARN comes with a list of CLI commands to execute different things like installation, administration, and publishing. You can run a user-defined script by executing the 'yarn' command. You can also execute a list of predefined commands using the Yarn.

Some of the popular Yarn commands are,

  • Yarn add - adds a new package.
  • Yarn init - initializes the development of a package.
  • Yarn install - installs the dependencies defined in the package.json file
  • Yarn remove - removes the package

About Author :

  • Author of Yarn Interview Questions

    Sharad Jaiswal

    Sharad Jaiswal is Sr. Web Developer from Noida area. He have rich experience in PHP, Angular Js, React, javascript and Node .If you any query or project on these programming you can drop your enquiry in comment section.

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.