Find answers to some frequently asked questions on HackerRank assessments for Front-end, Back-end, and Full-stack development roles.
Reboot/restart workspace
Why does my workspace hang while taking the assessment?
There can be a number of scenarios when your project workspace might get hung. Some common scenarios are listed below.
- Websockets are not enabled for your browser(applicable for IE and Edge). Click here to check if WebSockets are enabled or not.
- Extensive usage of local PC memory by the online IDE.
- When you try to push your code to the online workspace after working in offline mode.
What should I do if my workspace gets hung?
You may need to restart your workspace manually if you see it getting hung. Watch the below clip to know how to restart a workspace manually.
If your workspace gets stuck, we highly recommend that you take a backup of your project and reset it. Watch the below clip to know how to reset your project.
I have lost time due to the workspace reboot issue. Can I get an extension of the test time?
You can request the recruiter who invited you to the test, to give you an extension of test time because of the lost time. Recruiters may give you a time duration extension to complete the Tests in progress as well as send you reinvites to retake a Test.
Please note that HackerRank only provides a platform to conduct the challenges and cannot allow you extra time to complete the test.
Port already in Use
I am getting a "Port already in use" error whenever I am trying to execute my code
If you see the above error message, this means that the port which is allocated for your project is currently in use by another process or service. To make your code run/execute successfully, you would need to find out the other process/service which is running on the port and then kill that service before running your project.
How will I know which process is running on a particular port
To know the process that is running on a port, use below commands:
Operating System | Commands | Syntax |
Linux / Mac |
netstat |
$ netstat -ltnp | grep -w ':<port id>'
|
Linux / Mac |
lsof |
$ lsof -i :<port id>
|
Linux / Mac |
fuser |
$ fuser <port id>/tcp
|
Windows |
netsat |
netstat -aon | findstr<port_number>
Where, -a = Displays all the listening ports -n = stops the hostname lookup -o = lists the Process ID that is running on the port |
How will I kill a process that is running on a particular port?
Once the process ID is known, use the below commands to kill the process.
Operating System | Commands | Syntax |
Linux / Mac |
kill -9 |
kill -9 <process ID>
|
Linux / Mac |
sudo kill |
sudo kill -9 <process ID>
|
Windows |
taskkill |
taskkill /pid <process ID> /f
|
GIT Installation Issue
Why do I need Git?
If you are working on a HackerRank Project, you will need Git installed in your machine to sync between your local and HackerRank IDE or vice versa.
Use the below command to verify if Git is installed in your system or not.
$ git --version
If the above command returns version number, it implies that git is installed in your machine.
The above command does not return any version number for me. What should I do?
If no version number is returned when you run $ git --version, then you need to install git. Follow the below steps to install Git in your local machine.
Install GIT on MAC
- Download the latest version of GIT Installer for MAC
- Follow prompts to finish Git installation.
- Once the installation is completed, verify if Git is successfully installed or not using the below command.
$ git --version
- Once the installation is done, run below commands to configure your Git username and email ID.
$ git config --global user.name "Your Name"
$ git config --global user.email "Yourname@email.com"
Install GIT on Linux
- Install Git using apt-get command from your shell.
$ sudo apt-get update
$ sudo apt-get install git
- Once the installation is completed, verify if Git is successfully installed or not using the below command.
$ git --version
- Run below command to configure your Git username and email ID.
$ git config --global user.name "Your Name"
$ git config --global user.email "Yourname@email.com"
Install GIT on Windows
- Download the latest version of Git Installer for Windows.
- Double click on the setup file to start the installation process.
- On the GIT setup wizard screen, follow the prompts and finish the installation.
- Once the installation is done, open command prompt or GIT bash and run below command to configure your Git username and email ID.
$ git config --global user.name "Your Name"
$ git config --global user.email "Yourname@email.com"
Preview URL not working
The preview URL generated in the online IDE is not working. Getting “502: Bad Gateway error”.
To avoid this error, ensure the following.
- Install all the dependencies before you run your code. Click on the install in your online IDE to install the dependencies. Once the installation is done, click Run and open the Preview URL.
- Wait till the compilation is completed and the server is up otherwise you might get a “502: Bad Gateway” error while previewing your application website.
- To view your application website, always ensure that you click on the Preview link. One common mistake that we have observed is candidates clicking the local IP network instead of the preview link.
Git Push Error - Modify Read-only file
Getting error while trying to push code from local IDE to online.
If you are working in an offline IDE and want to push your code back to the HackerRank repository, you might encounter an error of the type shown in the below screenshot. This usually occurs if you have edited a read-only file and are trying to commit the same.

Follow the below steps if you get the above error:
- Identify the read-only file/files from the error message.

- Reset your project using below command
git reset HEAD~
- Use the command below to commit specific files, ignoring the read-only files.
git add config/<file name>
- Push your project to the online IDE.
git push
Project size > 25MB
Project size > 25MB
I am getting a "Repo too large" error while trying to save my code in the online IDE or push my work from local IDE to the online IDE.
While working on any Projects(front-end, back-end or full-stack) question, ensure to keep the size of your project to 25MB or less. Git push fails if your project size exceeds 25MB.
If you get the below error, you may try to push your code after removing the dependency files.
Here is a collection of useful .gitignore templates that you may want to refer to. Depending on the language/framework that you are using, remove the files included in the relevant .gitignore template while saving your changes. This will help you reduce your project size and avoid getting the above error.
Comments
0 comments
Please sign in to leave a comment.