Are you a candidate looking to sharpen your skills? Try our practice tests or view sample interview questions & Get hired by the best. Click Here×

NPM Online Test

Topics Covered

  • Folder structures
  • JSON
  • Queries
  • Database
  • Referencing
  • Operators
  • Database Objects
  • URL
  • Tables

Useful for hiring

  • JavaScript Developers
  •  Full Stack Developer
  •  Node.js Developers

Start hiring job-fit candidates using this assessment


"Interview Mocha has provided UNEECOPS with a veritable assessment platform with a comprehensive test library, online test platform, and intelligent reports. This made it easier for us to map different job openings with job-fit candidates and recruit faster."

Nisha Chandila, UNEECOPS,
Talent Acquisition Manager

You need to (hypothetically) find a certain temporary file of your application using npm. Assuming that the default locations were used, which of the following environment variables determines where the file is located?

    • TMPDIR

    • TMP

    • TEMP

    • Any of the mentioned


You installed npm in your system and started the server on the same system on port 5030. If you want to install some packages in the npm registry installed on your machine then, which of following options can be used?

Note: There can be multiple correct answers to this question.

    • npm --registry=http://localhost:5030/ install <package_name>

    • $ npm persist registry=http://localhost:5030/
      $ npm install <package_name>

    • $ npm set registry http://localhost:5030/
      $ npm install <package_name>


You installed npm to your machine, but the owner hasn't been set. If you want to set the current user(username) to be the owner then, which of the following commands can be used?

    • sudo chown -R $(whoami) $(npm config get prefix)

    • sudo dirown -U $(username) $(npm getconfig prefix)

    • sudo chown -U $(username) $(npm getconfig prefix)

    • sudo dirown-R $(whoami) $(npm config get prefix)

Good News! You can customize this test as per your requirement

  • Choose and add questions from Interview Mocha question libraries

  • Add your own set of questions

  • Customize test settings like duration, number of questions, passing score, web proctoring and much more

  • Mail us at to create a custom test

Looking for a tailor-made test, to suit your assessment needs?

Get in touch

Global companies using Mocha assessments

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • akamai

How Mocha assessments are brewed

Speed up your IT recruitment with Interview Mocha

  • 500+ IT skill tests
  • 20+ coding languages
  • 50+ domain knowledge tests
  • 100+ digital 2.0 skill tests
  • Customer focus aptitude tests
  • Enterprise ready features & more...

Why hiring managers and recruiters across the globe love Interview Mocha

Take your first step to hire job fit candidates