Find answers to some frequently asked questions on HackerRank assessments for Front-end, Back-end, and Full-stack development roles.
Reboot/restart workspace
- 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.
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.
You can request the recruiter who invited you to the test to extend the test time because of the lost time. Recruiters may give you a time duration extension to complete the Tests in progress and send you re-invites to retake a Test.
Typically, you can reach out to the recruiter that sent the invitation by going to the original invitation email you received with your test credentials. You would then click "Reply All" and send your request. The hiring firm would typically be included in the email when you click "Reply All."
Please note that HackerRank only provides a platform to conduct the challenges and cannot allow you extra time to complete the test.
To know the process that is running on a port, use the below commands:
eg.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 |
Once the process ID is known, use the below commands to kill the process.
Eg.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
Use the below command to verify if git is installed in your system or not.
$ git --version
If the above command returns the version number, it implies that git is installed in your machine.
If no version number is returned when you run $ git --version, you need to install git. Follow the below steps to install git on 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 the 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 the 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.
- Follow the prompts on the GIT setup wizard and finish the installation.
- Once the installation is done, open the command prompt or GIT bash and run the 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
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
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 the 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
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.