
HackerRank's Frequently Asked Questions page is a central hub where its customers can always go to with their most common questions. These are the 325 most popular questions HackerRank receives.
You can debug on your computer using any tool that you like. When coding in our online editor, anything printed to STDOUT will be matched against the challenge'sExpected Output(so printing debug statements there could cause you to fail the challenge). If your submission language supports printing to STDERR (e.g.,cerrfor C++,System.err.printlnfor Java,console.errorfor JavaScript, etc.), you can send your debug output there and it will show up in a separateErrorbox underneath the challenge'sExpected Output.
View ArticleHow to create a challenge:
Please click on your username ( upper right corner) and select “Administration” from the drop down list
https://www.hackerrank.com/administration/challenges
Go to the challenges tab to create challenges for your contest or enter the URL https://www.hackerrank.com/administration/challenges within the address field
To create a challenge from https://www.hackerrank.com/administration/challenges, please click on the green “Create Challenge” button located to the right side of the screen.
On the create challenge page https://www.hackerrank.com/administration/challenges/create fill in the following 7 fields/areas:
Challenge Name, Description, Problem Statement, Input Format, Constraints, Output Format, Tags and click on the green “Save Changes” button located towards the lower right of the screen.
Overview of the create challenge page:
You will write the problem statement on this page. An ideal problem-statement should contain:
Challenge Name:This will be the title of your challenge. Try to pick a creative and meaningful name.
Description:Write a one-line description of the main task which will be displayed when you share the problem link.
Problem Statement:Describe your challenge in details. A good problem-statement should be well-formatted and concise.
Input Format:Clearly describe how the Input is organized (focusing on distinguishing the number of inputs from the actual Input, and whether different parts of the Input are space-separated or in new lines).
Constraints:Mention the range of the variables you used to describe the problem statement. Constraints help the contestants to assess the input size and to figure out if his algorithm will terminate in alloted time.
Output Format:HackerRank challenges work by comparing STDOUT Output with the test cases. Clearly describe the Output format in the exact way that the Output should be generated by the programmer.
Tags:Enter descriptive tags/labels.
Sample Input, Sample Output and Explanation:
After you have saved your challenge from the creation page, you can edit the challenge from the manage challenge tab . You would enter the editing page by clicking on the challenge name. Once you’ve reached the editing page you would scroll down and enter a sample input, sample output and and explanation. After you’re done, you can then click the green “Save Changes” button to the lower right.
You should create two or more example of Input of whose the formatting matches the input test cases identically. Write a detailed explanation as to how the sample Input gives rise to the given sample Output by following the algorithm/requirements in the problem statement. You can create them by going to test cases tab.
View ArticleHackerRank is on the look out for excellent programmers with a special interest in creating coding challenges. From algorithms to full-stack challenges, you can create, test and review new challenges for HackerRank and get paid in the process. Our pay scale varies from 25 USD - 200 USD per challenge, based on the difficulty level of the challenge, and your role (problem setter/tester). As a problem curator, you will work with us remotely and stay connected online.
If you would like to become a paid contributor and have your challenge showcased in a HackerRank contest, here are a few steps you'll need to follow:
Please create 3 challenges (1 easy, 1 medium and 1 hard) in your HackerRank account.We are open to challenges in any domain, key areas being Algorithms, Data Structures, Front-end and Back-end Development, Artificial Intelligence, Machine Learning, and Database questions.
Please complete this support form and share the links for the same three challenges here.
Note: You can find assistance to create the challenges on our challenge creation guide.
If this opportunity interests you, reach out to us via our support form, and we'll be in touch shortly! We look forward to creating quality content with you!
View ArticleBack to top
Welcome to HackerRank DSL (Domain Specific Language) Documentation! You can use our DSL to generate code stubs that read test case data from standard input in HackerRank challenges.
Writing Comments
Supported Data Types
Reading and Printing Variables
Reading and Printing 1D Arrays
Reading and Printing 2D Arrays
Reading and Printing Linked Lists
Reading and Printing Binary Search Trees
Reading and Printing Graphs
Declaring and Invoking Functions
Writing Loops
1. Writing Comments
The DSL supports custom comments in the form #YOUR_COMMENT. A special comment #StartCode generates "Write your code here".
Example
DSL Example:
1
2
Generated Code:
Python
Java
Cpp
2. Supported Data Types
The following data types are supported for reading variables, arrays, linked lists, and binary search trees:
Boolean: boolean
Character: character
Integer: integer
Long Integer: long_integer
Float: float
Double: double
String: string
3. Reading and Printing Variables
To read a variable the DSL is DATA_TYPE(VARIABLE_NAME). For example, to read an integer, n, the DSL is integer(n). Reading space separated variable is also supported. For example, to read two integers, n and m separated by space, the DSL is integer(n) integer(m).
To print a variable the DSL is print(DATA_TYPE, VARIABLE_NAME). Note that only one print each statement per line is supported.
Example
DSL Example:
1
2
3
Sample Input
Generated Code:
Python
Java
Cpp
4. Reading and Printing 1D Arrays
To read the array given that elements are given separated by space, the DSL is array(DATA_TYPE, VARIABLE_NAME, ELEMENT_COUNT, single) and to read the array such that elements are given each on a new line, the DSL is array(DATA_TYPE, VARIABLE_NAME, ELEMENT_COUNT, multi). Here, ELEMENT_COUNT could be:
An integer constant describing the total number of elements.
An integer variable which is already read.
A simple expression consisting of integer constants, integer variables, and, (+,, ) operators only.
Underscore which suggests reading the total number of elements before reading the array.
To print an array the DSL is print(DATA_TYPE_array, VARIABLE_NAME, SEPARATOR). The separator is optional and default value is SPACE. The valid values are COMMA, SPACE, NEWLINE, and _ (Underscore).
Example
DSL Example:
1
2
3
Sample Input
Generated Code:
Python
Java
Cpp
5. Reading and Printing 2D Arrays
To read 2D array the DSL is 2darray(DATA_TYPE, VARIABLE_NAME, ROW_COUNT, COLUMN_COUNT). Here ROW_COUNT and COLUMN_COUNT could be:
An integer constant describing the total number of rows and columns.
An integer variable which is already read.
A simple expression consisting of integer constants, integer variables, and, (+,, ) operators only.
Underscore which suggests reading the total number of rows and columns before reading the array.
To print the 2D array the DSL is print(2d_DATA_TYPE_array, VARIABLE_NAME). The array is always printed in matrix form, i.e., all the elements of each row are printed space separated and each row is printed on a new line.
Example
DSL Example:
1
2
3
Sample Input
Generated Code:
Python
Java
Cpp
6. Reading and Printing Linked Lists
The DSL supports singly and doubly linked lists. The DSL to read singly linked list is DATA_TYPE_singly_linked_list(VARIABLE_NAME) and to read doubly linked list is DATA_TYPE_doubly_linked_list(VARIABLE_NAME). The generated code first reads the total number of nodes followed by the node values each on a new line. The DSL supports reading only one linked list.
The DSL to print singly linked list is print(DATA_TYPE_singly_linked_list, VARIABLE_NAME, SEPARATOR) and to print doubly linked list is print(DATA_TYPE_doubly_linked_list, VARIABLE_NAME, SEPARATOR). The separator is optional and default value is SPACE. The valid values are COMMA, SPACE, NEWLINE, and _ (Underscore).
Example
DSL Example:
1
2
Sample Input
Generated Code:
Python
Java
Cpp
7. Reading and Printing Binary Search Trees
To read binary search tree the DSL is DATA_TYPE_binary_search_tree(VARIABLE_NAME). The generated code first reads the total number of nodes followed by the node values each on a new line in order of insertion. The DSL supports reading only one binary search tree.
The DSL to print binary search tree is print(DATA_TYPE_binary_seach_tree, VARIABLE_NAME, SEPARATOR). The separator is optional and default value is SPACE. The valid values are COMMA, SPACE, NEWLINE, and _ (Underscore).
Example
DSL Example:
1
2
Sample Input
Generated Code:
Python
Java
Cpp
8. Reading and Printing Graphs
The DSL supports reading integer weighted graph and integer unweighted graphs using the DSL weighted_integer_graph(VARIABLE_NAME) and unweighted_integer_graph(VARIABLE_NAME) respectively. The generated code first reads the total number of nodes and edges separated by space followed by each of edges in the form start-node end-node and optional weight separated by space. Note that all the inputs must be integer only.
The DSL does not support printing graphs.
Example
DSL Example:
1
2
Sample Input
Generated Code:
Python
Java
Cpp
9. Declaring and Invoking Functions
The DSL to define function is function(RETURN_TYPE, FUNCTION_NAME, PARAM1TYPE PARAM1NAME, PARAM2TYPE PARAM2NAME,, PARAMnTYPE PARAMnNAME, #FUNCTION_BODY_COMMENT). If the function does not return anything, the return type should be void. The function parameters and body comment are optional.
To invoke a function, the DSL is invoke(RETURN_TYPE, RETURN_VARIABLE_NAME, FUNCTION_NAME, PARAM1NAME, PARAM2NAME,, PARAMnNAME). If the function return type is void then the return variable name could be replaced with _ (underscore).
Example
DSL Example:
1
2
Sample Input
Generated Code:
Python
Java
Cpp
10. Writing Loops
The DSL supports performing repeated tasks inside a loop. The DSL syntax for loops is:
loop(VARIABLE_NAME)
VALID_DSL_STATEMENT
endloop
Here, VARIABLE_NAME is an integer variable which is already read and describes the total number of times the loop must run. The DSL also supports nested loops.
Example
DSL Example:
1
2
3
Sample Input
Generated Code:
Python
Java
Cpp
View ArticleYour Hackos are located under your profile settings:
What are Hackos?
Hackos are HackerRank currency you can earn and spend on the site.
How do I get Hackos?
When you register on HackerRank, you are immediately awarded with 100 Hackos. As you continue to solve more challenges, you earn more Hackos. Please keep in mind the amount of Hackos earned is not based on the score or points awarded for a challenge. The amount of Hackos that you earn on solving a problem depends on the Level of the challenge ( ie. a difficulty level of Easy for a challenge will let you earn 5 points), and is shown below:
All challenges solved till now would be marked as Practice.
You also earn Hackos for maintaining a login streak, where a streak of 1 day grants you 1 Hackos, 2 days grant you 2 Hackos, and so on, with an upper limit of 10 Hackos.
Where can I use Hackos?
You can currently use Hackos to buy test cases. Each test case costs 5 Hackos. So if your total Hackos count is 40, and you buy 2 test cases, your total Hackos count will become 30.
Is that all?
Currently yes, but we will soon be adding more ways to earn and spend Hackos.
View ArticleThe best way to obtain a shirt is to participate in our rated contests or reporting security issues on our bug bounty program. If it helps, here a link to our contest pagehttps://www.hackerrank.com/contests .
View ArticleEach challenge page has an online editor embedded in the page for you to write and test your code in. If you're more comfortable coding in your favorite IDE, you can always upload your code to the challenge page when you're done!
View ArticleIf a lot of people have already solved a challenge, the odds are that the issue is in your code.
There could be a couple reasons for this:
Your code doesn't match the expected output.The output produced by your code must exactly match the output expected by the test case, so something like a spelling error in your output will cause you to fail the challenge.
You're using a different compiler.Check out our Environment page for up-to-date information on how we're compiling your code.
Your code's behavior is unpredictable.If you're using C/C++, double check for uninitialized variables or invalid memory accesses, as they can cause unpredictable behavior. If you overrun an array or attempt to print the contents of an array cell that was never initialized, your output may look like it's correct but you'll fail the challenge (invisible garbage characters are the worst, we know).
Ask for help.Each challenge has aDiscussionstab where you can collaborate with fellow programmers who've attempted that challenge. When asking for help, be sure to provide detailed information that will enable others to understand what you're talking about.
If you're really convinced that there is an issue with a test case, contact us directly with specific information about the challenge and test case number. Be sure to specifically state why you think it's not correct!
View ArticlePlease send us the link to your contest and give us at least 3 days before the contest to make it public on our college contest page. We do not provide a plagiarism detector for contests outside of our official HackerRank contests.
View ArticleWe run your code against hidden test cases. Depending on the output your code produced, you can get the following verdicts:
Accepted.Congratulations, your code passed all the test cases! It's time to solve a new challenge!
Wrong Answer.The output your code produced didn't match the output expected by the test case. Rethink your approach and think about whether you misunderstood the problem or missed a corner case.
Terminated due to timeout.Your code doesn't solve the problem efficiently enough! If you write aO(2n)solution whenn = 100, it will surely time out and you're going to need to optimize your algorithm. The time limits are different for each language (some languages are slower than others), and you can see the limits for all the languages we support at our Environment page.
Runtime error/Segmentation Fault.Your code terminated unexpectedly. Did you overrun your array? Is your code trying to divide by zero?
Abort Called.Are you using too many resources? Maybe an array you created is too large and exceeds the memory limit, or an assert statement in your code is failing.
After you submit your code, hover your mouse cursor over the icon for each test case to view the verdicts and runtime for each test case your code was tested against.
View ArticleOur challenges cover a wide range of domains such as:
Algorithms
Artificial Intelligence: Write an AI bot to play a 1-player game, or play against other AI bots!
Distributed Systems
Databases
Mathematics
Cryptography and Security
Language Specific Domains: Test your coding chops with Java, C++, Ruby, Python, Linux shell, SQL, a variety of functional languages.
Don't see what you're looking for? We're adding new domains all the time!
View ArticleYou can delete your account by going tohttps://www.hackerrank.com/settings/account. Once you are on the page you should scroll down until you see the delete button. Please be aware that all data will be permanently lost if you delete your account.
https://www.hackerrank.com/settings/account
If you signed up via a social media account, (e.g. Google, Github, Facebook, etc.) you can still create a password to delete your account. To do this, I'd recommend that you first reset your password via the "Forgot your password" link on this page https://www.hackerrank.com/login.
After resetting your password, to delete your account, please go to this pageand scroll down to find the delete button. To complete the deletion process, you'll have to enter your password again.
View ArticleYou can sign up for our ambassador program here https://www.hackerrank.com/campus-ambassador-program.
Thankyou for your interest in our Ambassador Program. Our goal is to be the largest developer community in the world and your efforts play a critical role in making that happen. Our Ambassador program is completely self-serve and once you apply, you are automatically considered.
Here is a quick snapshot of our goals:
Drive students to compete in HackerRank Contests and CodeSprints. Check out upcoming CodeSprints https://www.hackerrank.com/contests.
Host your own university CodeSprint on HackerRank
Introduce HackerRank to Computer Science professors/TAs who teach programming courses
We also made our contest platform self-service. This means you can now create your own contest and add any challenges from our extensive library of 1,300+ challenges across multiple domains to your private contest.
To create a contest, you will need to:
1) Create a HackerRank account - www.hackerrank.com
2) Create a contest - https://www.hackerrank.com/administration/contests/create
3) Share your customized url with all coders you would like to invite to your contest.
When you are ready to publish/share your contest on our college contest page just email us the necessary info (i.e. link to your contest) and we will add it on our end.
Lastly, we are unable to give away any swag (e.g. t-shirt) at this time. We will update you when this changes.
You can also join our Facebook Contest and Challenge Creation group https://www.facebook.com/groups/hackerrankcreators/.
View ArticleHackerRank is a place where programmers from all over the world come together to solve problems in a wide range of Computer Science domains such as algorithms, machine learning, or artificial intelligence, as well as to practice different programming paradigms like functional programming.
View ArticleThere isnoway to unregister from contests or tutorials, howeverif you do not participate in the contest your ranking will not be affected. As for tutorials, even if youdo not complete them dailyyou can come back at any time to complete the activity.
View ArticleContest overview and contest creation - private or college contests
Our custom-contest platform is a self-service platform. This means you can now create your own contest and add any challenge from our extensive library of 1,300+ challenges across multiple domains to your private contest. After you’ve created a contest, there will be several tabs that you can access: Details, Challenges, Advanced Settings Moderators, Notifications, Signups, and Statistics
https://www.hackerrank.com/administration/challenges/create
To create a contest and add a challenge, you will need to:
Setup a HackerRank developer/community account - www.hackerrank.com/signup or login via https://www.hackerrank.com/login
Create a contest through https://www.hackerrank.com/administration/contests/create
On the following page please enter the contest name, start/end time, organization type, organization name and click on “Get Started”
After the contest is created, the contest name and customized URL that you can share will visible towards the upper left corner of the screen.
You can share your customized url with all coders you would like to invite to your contest. Or, if you want to make your contest public on our college contest page just email us the link to your contest and we will add it on our end.
Adding a challenge
If you left click the Challenges tab you can choose to either add a challenge from our standard library ( search by name) or you can add a custom challenge that you can create via.
View ArticleHere are a few common solutions that may help:
Have you double checked to make sure there are no extra spaces or blank lines in your output? This could be causing your test cases to fail.
Are you using a different compiler? Check out our Environment pagehttps://www.hackerrank.com/environment for up-to-date information on how we're compiling your code.
Your code doesn't match the expected output. The output produced by your code must exactly match the output expected by the test case, so something like a spelling error in your output will cause you to fail the challenge.
We encourage you to post your issue in the discussion area, which is a forum moderated by HackerRank. You may find other users who have come across the same issue and received a resolution.
Also, you can choose to unlock the editorial solution or go to the leaderboard and reveal other users' solutions. Note, if you view the editorial or unlock other users' solutions, you will not score any points for that challenge.
**code help for Euler**
Currently, we provide limited code help support for this domain. Project Euler statements have been adapted from https://projecteuler.net with HackerRank original test cases. Please look through related submissions based on your preferred language or feel free to post on our discussion forum to find a solution.
View ArticleYes! There are a few options:
Compete.We run regular hackathons with cash prizes. For our sponsored competitions, we even connect you to companies who are hiring as long as you opt-in to being contacted. Check out our upcoming competitions to start competing!
Jobs.Solving the coding challenges at our Jobs page lets you apply for software engineering positions at a variety of companies at once, or even just the companies you're interested in working for.
Paid Contributor.You can create your own challenges and become a paid contributor.
View ArticleTry to think about what could have gone wrong. Maybe your approach is wrong, perhaps you are missing some corner cases, or maybe you have a bug in your code. Maybe you're solving a different problem than the challenge is asking you to solve. Your fellow coders are a great resource! Check out theDiscussionstab to see if somebody else hit the same stumbling block or ask for help from others who've completed the challenge.
View ArticleIf you would like to unsubscribe from a particular type of email please go to the bottom of that email and select unsubscribe. If you would like to unsubscribe from every email that does not relate to account security please go to https://www.hackerrank.com/settings/email-preferences and change your email preferences.
View ArticleDon't share hints/codes/strategy during a live contest it violates the contest rules. It's always nice to help a fellow programmer learn, but posting spoilers during a competition makes it unfair. Once the contest ends, feel free to compare solutions with other coders and help others learn how it's done!
View ArticleIf you have two accounts that you wish to merge, you can use theMerge Accountfeature on the settings page. Please note that the merge process is only recommended in situations where the progress on both of these accounts is required to be kept. If one of the accounts has no progress, we recommend you delete that account and add the email as a secondary email address to the remaining account.
Also note that merges are not possible in the following cases:
Both accounts have participated in the same contest.Allowing a merge in this case will change the rankings of all other users.
The account to be merged has participated in any rated contest.It is not possible to modify the rating of the existing account to consider the performance of the merged account.
Both accounts are members of the same team for a contest.This can be rectified by going to the Manage Your Teams page and deleting that team.
Additionally, while challenge submissions and contest performance will be merged, there are some entries that will not be merged between two accounts:
Ratings
Medals
Messages
Hackos
Tutorial Progress
Follow Data
View ArticleIf you're interested in learning, you might want to first review our FAQ page https://www.hackerrank.com/faq and the tutorials track on our site
https://www.hackerrank.com/domains/tutorials/. We offer a "30 days of Code" subdomain and a "Cracking the coding interview" subdomain ( includes video tutorials).
For additional help you might also want to check the discussion area, which is a forum moderated by HackerRank. You may find that other users may have run into the same issue and received a resolution.
If you are still stuck, you can unlock the editorial solution, which explains how to solve the challenge. You can also go to the leaderboard and reveal other users' solutions.
**Note, if you view the editorial or unlock the other users' solutions, you typically (depending on the challenge) will not be eligible to score more points for that challenge.
View ArticleFor information about languages supported, memory, and time limits, please visithttps://www.hackerrank.com/environment
View ArticleThere are limited shortcut keys (hotkeys) which are currently supported in challenge solving page:
alt/option + R :Run code
alt/option + Enter :Submit code
alt/option + F :Enable full screen
Esc :Restore full screen
View ArticleRead the statement a few more times, and check theDiscussionstab to see if another coder posted something that will help you. If you still find it confusing, ask for help! If there's something in the problem statement you find misleading and think could be improved, submit feedback about the challenge and mention the specific sections you find confusing. Comments like "The challenge is confusing!" don't communicate enough information for people to know what you're talking about, so it's always best to be courteous and specific (e.g., "The second paragraph confuses me; is the graph directed or undirected?") when asking for help.
View ArticleYou can learn all about our scoring/rating system and how to earn badges and medals on our scoring page https://www.hackerrank.com/scoring.
View ArticleYour submission for the contest has been removed due to plagiarism. We detected that your code was too similar to that submitted by another user or that your submission time was too short. As such, you have been disqualified and removed from the leaderboard.
Please remember not to not share code or strategy until after the contest ends to avoid being disqualified in the future.
View ArticleWhen you finish the first version of your code, clickRun Codebutton to run your solution against one or more small sample test cases. Once you're confident your solution covers the entire problem, clickSubmitto run it against the entire set of test cases (or bots) and get a score for the challenge. Don't worry if you don't pass all the test cases, you can always rework your code and submit it again for an updated score. The score that shows up on the leaderboard will be the one for your top-scoring submission.
View ArticleCheck out the Writing State Information to a File tab on ourEnvironmentpage.
View ArticleYourtop three most used languages will be displayed on your profile page. Currently, there is no option to add or delete those three languages from your profile page.
View ArticleYou can find a complete list of all the languages we accommodate and details on timeout limits on this page https://www.hackerrank.com/environment/languages. You can also review the Sample Problem Statement tab to get familiar with the format of our problem statements including STDIN and STDOUT.
View ArticleWhat types of contests do you host?
101-Hack.In this monthly algorithmic contest, you have two hours to solve five challenges. The top-10 winners get a HackerRank t-shirt.
HourRank.This is our shortest contest you have one hour to solve three or four algorithm challenges. The top-10 winners get a HackerRank t-shirt.
Week of Code.A weeklong algorithm contest where one new challenge is released each day. Things get harder as the week progresses, and the challenges are run against additional test cases at the end of each day. You can submit (or resubmit) solutions for prior days' challenges throughout the week, but there's a small point penalty for submitting solutions for challenges released on previous days. The top-10 winners get a HackerRank t-shirt.
Ad Infinitum.We host this 48-hour Mathematics contest every three months. The top-10 winners get a HackerRank t-shirt.
Real Data/Machine Learning contests.This weeklong contest focuses on real-world data skills and requires the use of machine learning techniques.
Language/Domain Specific Contests.We periodically hold competitions that focus on a specific language (e.g., C, Java, Python, etc.) or domain (e.g., AI, machine learning, databases, etc).
Company Contests.We regularly hold competitions sponsored by specific companies looking to hire engineers. These contests vary in duration, rules, or challenge type/topic, depending on what the sponsor is looking to test for. After the contest, the sponsoring companies contact top performers on the leaderboard about job opportunities (so be sure to opt-in).
World CodeSprint.A 24-hour contest with 7-8 challenges. These contests are sponsored by multiple companies and have some seriously worthwhile prizes for the winners!
What is a rated contest?
Rated contests affect your profile page ratings. You can also get different ratings for completing challenges in different domains, as well as earn medals when you perform well.
View ArticleIf the email you want to add to your HackerRank account belongs to a different HackerRank account with no activity, you can delete the account using theDelete Accountfeature on the Account Settings page.
Add the new email ID to theEmail Addressessection on the settings page. You will receive an email from HackerRank to confirm your access of the ID.
Once you have confirmed your email, the entry will show up asverifiedon the settings page. You will also have an option to "Make primary". Click on that option.
View ArticleHackerRank's CodePair is a live and interactive coding environment for hiring companies to conduct technical interviews. Typically, in a companys hiring process, Candidates who clear their initial level of assessments are subsequently invited to participate in a coding interview on HackerRank's CodePair platform.One of the several advantages of HackerRank's CodePair is that Candidates can attend these interviews remotely. It isalso a great platform for Candidates to showcase their problem-solving and programming knowledge skills to their interviewers.
For Candidates who have an upcoming CodePair interview, this article describes:
An interview preparation checklist
What they can expect during the interview
The CodePair interview platform
CodePair Interview Preparation Checklist for Candidates
Checklist Item
Details and References
CodePair Interview invite
Ensure that you have read your Recruiters invite for the upcoming coding interview and you are provided with the link to participate in the CodePair interview at the scheduled time.
Browsers to use
The latest versions of Google Chrome and Firefox browsers are recommended for CodePair interviews. Ensure you have installed any of these browsers before the interview.
Familiarizing yourself with CodePair
Refer to Understanding the CodePair interface topic for a walkthrough of the CodePair platform.
Coding environment
In the coding interview, you are expected to write optimal solutions to coding questions. Therefore, HackerRanks coding environment has a specific time and memory limit for code execution in every programming language.
Refer HackerRank's Environments page to understand these limits. During the interview, click the iconin the right-hand corner of the CodePair interface to access the Environments page.
Code execution and outputs
Your coding solutions are judged based on whether the Question's Test cases execute successfully to produce the exact expected output.
Click here to refer related topics in our Candidate Knowledgebase.
Internet connectivity
Ensure that you have uninterrupted internet connectivity during the interview. You can test your connection here and here.
What can Candidates expect during a CodePair interview?
Based on the specific skills required for the job you are being interviewed for, you can expect:
One or more interviewers to be part of the live coding session and interact with you over CodePair's live video-chat.
To be given one or more challenging coding Questions by your interviewers and expected to write optimal coding solutions and show the expected output.
To be asked to code is a particular programming language, and sometimes, you may be allowed to choose from a permitted list of languages.
Your interviewers to collaborate with you to edit code, define functions and expect you to write their logic, give you custom input values to produce an expected output, etc.
Your interviewers to assess your programming abilities based on your optimal coding approach during the interview period.
Note: If you have previously attempted the hiring companys assessments or interviews on the HackerRank platform, your performance and scores in those assessments may also be available to the interviewers for their reference.
View ArticleThere're three aspects to code auto-submission as explained below:
You typed the code, but never submitted or compiled it, i.e., never clicked Run Code or Submit code & Continue:
HackerRank will submit the last version of the typed code if the Test times out.
You typed the code and clicked on the Submit code & Continue button. After submitting, if you updated/tweaked the code but never re-submitted or compiled it again:
HackerRank will submit the previously submitted code (not the tweaked code) if the Test times out and gets closed automatically.
You typed the code and clicked on the Run Codebutton. However, you didnt click on theSubmit code & Continuebutton
HackerRank will submit the latest compiled version.
View ArticleHTML/CSS/Javascript questions aid in evaluating a candidates front-end development skills. Front-end developers create the basic design and layout of the website, including the images, content, buttons, links, and navigation. They also ensure that the flow of the website is smooth and error free. This front-end structure is then used by the back-end developers to add business logic and connect databases and processes.
Candidates have to write HTML, CSS, and JavaScript according to a prompt to prove that they know how to structure, design, and add logic to web pages. Candidates can render their code in the browser by simply clicking a button.
Learn how to create and score an HTML/CSS/JavaScript question here:
Creating an HTML/CSS/JavaScript Question
Scoring an HTML/CSS/JavaScript Question
View ArticleIn your Coding Questions, test cases are the different types of inputs to your code to test your defined logic and produce the output. A test case is termed passed when the output from your code exactly matches the expected output. Else, the status Wrong Answer is indicated against the test case.
Depending on the complexity of your Question, the test setter may define one or more test cases to validate your logic. These test cases are automatically executed when you run your code, and the results help you to understand whether your coding solution is able to address the edge scenarios in the test cases and generate the expected output.
Following is an illustration of a Coding Question in a HackerRank Test. When the code is run, the test cases are executed with the input from code to display the results and the output.
Hidden Test Cases
Test Case execution status when your code is run
Typically, the score or grade for a coding problem is calculated and assigned based on the number of test cases that succeed to produce the expected output. Refer the How are my coding questions graded or scored topic for more information.
For Coding Questions, your test setter may include the following types of test cases to validate your code against the expected output:
Sample Test Cases - These are model test cases for initial validation of your logic to help you gain a better understanding of the problem. The sample test cases may or may not include a score for successful execution.
- These are the test cases which thoroughly validate your logic for various corner cases and involve specific scores for successful execution.
Sample Test cases in a coding Question
Hidden test cases in a coding Question
View ArticleIn your coding Questions, the Wrong Answer status of your test cases implies that your program or coding logic is unable to produce the exact expected output for the test cases due to various reasons.
Some primary causes and possible resolutions are explained below:
Causes
Possible Resolution(s)
Mismatch of input and output values
Test cases fail when the input passed by your code may not be in the exact format as expected by the test case. Also, when the output returned by your code is not the exact expected output format, you will see a Wrong answer status.
When you write your own programs, ensure that you've understood the expected input and output values.If available, download the sample input and output values for reference.
Debug using custom input values
A mismatch between the output formats
Causes
Possible Resolution(s)
Question comprehension -handling edge cases
If some of your Test cases have passed, but you see a "Wrong Answer" status for others, it may imply that your coding logic is unable to handle the corner cases expected from the solution. For example, test cases which validate boundary values may fail if you've not written the logic to check for boundary values.
Your understanding of the question and the expected solution may differ. A problem can have multiple solutions, but your logical solution must be based on the given constraints in the Question.
Debug your code and validate different corner cases with custom inputs.
Ensure that you've understood the expected solution and the various constraints explained in the problem statement. Modify your program or coding logic accordingly.
An incorrect output from the solution
Causes
Possible Resolution(s)
Issues with code formatting or package guidelines
Check for other issues in your code such as:
Extra/missing whitespaces
Newlines
Debug output values printed in the "Your Output" area. After debugging, you must remove or comment your debug print statements in code.
Incorrect Class or Package names - (For Java, Scala and Clojure projects ensure that the correct naming guidelines are followed for Classes and Packages. This is required for your code to run and execute the test cases).
Debug output is compared with the expected output
It is recommended that you verify the above-mentioned causes and also debug your solution to identify the issues.Refer to the following topics for information about debugging your code:
Debugging a complete program
Debugging your logic in Functions
View ArticleCodePair provides a unique live coding platform for conducting technical interviews online. Typically, if a candidate is shortlisted from the first level of assessments,then a CodePair interview can be conducted. CodePair provides the interviewers all the flexibility to recreate an experience similar to an on-siteinterview. It is atime-efficient and cost effective method to remotely evaluatecandidates. Our platform gives the interviewersthe ability togauge a candidate's coding and problem solving ability in real-time.
Following are the key features of CodePair:
Access to library: Interviewers can select any available question in their personal library for CodePair interviews. This makes it easy to show the problem statement and code stub to candidates. Alternatively, the interviewers can create new questions or access HackerRank library, if required.
Code collaboration:All participants in the interview can edit code, provide input, and test code by running it live on our platform.
Chat functionality: Built-in text, voice, and video chat ensures that the interviewer and the candidate can communicate with each other throughout the interview using their preferredmode.
Playback feature: The automatically generated interview report recreates the entire interview for review by the hiring team. This ensures that other members of the hiring team apart from the interviewer can also review candidates' interview performance in detail.
Notes: The interviewers can take notes that are not visible to the candidate. These notes can be shared with the other team members during the evaluation and decision making process.
Built-in IDE: CodePair has a built-in IDE that supports over30 languages. This ensures that interviewers have the ability to evaluate the candidate as per their job requirements.CodePair interviews are dynamic just like on-siteinterviews. It gives interviewers the ability tochange and customize questions after they see the progress of the candidates. For instance, if a candidate is able to solve the givenquestions quickly, the interviewer might decide to test the candidates on other skills in the questions that follow.
Take a video tour of CodePair!
View ArticleOn the HackerRank Coding environment, most of your programs require to read input and write the output using the Standard Input stream (STDIN) and the Standard Output stream (STDOUT) methods. You must use the language-specific input and output statements in your code. Forexample, if you are coding in C, you must use the scanf() statement to read input into your program andprintf()to write the output.
In your Hacker Tests, you can access a ready-reckoner to know the programming language specific STDIN and STDOUT methods to use for reading input and writing the output from your code. You can also see the HackerRank Environments Page for information.
In the Test, click the Test Cases in your Coding Question icon on the left, and select F.A.Q. Scroll down in the pageto refer theinput-output methods to be used for coding in different programming languages.
Accessing the help page in your HackerRank Test
Alternatively, in the code editor, access the section shown below for help, and select the Click here link.
Viewing the help page from the code editor
STDIN
This is the standard streamto provide or read input values to a program. For example, consider a HackerRank sample question to read two integers, say a and b, and return their sum as the output.
If coding in C#, you must use Console.ReadLine()to read input values from Test Cases into the variablesa and b.
a= Console.Readline();
b = Console.Readline();
If coding in C, you must use the scanf() statement to read the integer value inputs to your program.
scanf("%d,%d", &num1, &num2)
STDOUT - This is the standard stream to write or print the output from your code.For example, for the above-mentioned coding question, you need to write the output from your program.
If coding in C#, you must use the Console.WriteLine() statement to print the output value.
Console.WriteLine(sum);
If coding in C, you must use the printf() statement to write the output value from your program.
printf("%dln", a+b);
A sample C program using scanf() for input and printf() for output
The output printed from your program
You can access the HackerRank Sample Test to practice coding and familiarize yourself with the environment before taking up the actual Test.
In your HackerRank coding tests, to execute your code successfully and return the expected output, it is essential that you provide the expected input(s) to your program and print the output value(s) in the exact expected format. For detailed information, refer to the following topics:
Debug Using Custom Input
Failed Test Cases or Wrong Answer Status
View ArticleHackerRank's Tests and CodePair interviews aim at assessing Candidates' knowledge in programming and problem-solving techniques. For Questions presented in these assessments, Candidates are expected to provide their own original answers.Your test setters may use practices such as proctoring and full-screen mode Tests to keep a tab on malpractices by Candidates.
For Coding assessments, in particular, HackerRank uses a powerful tool to detect plagiarism in the Candidates' submitted code. The Test report of a Candidate highlights any plagiarised portions in the submitted code and helps evaluators to verify the integrity of answers provided in the Test.
The plagiarism detector uses specialized methods to identify and report:
Any overlaps in code submitted by different Candidates.
Replicated code from original sources on the internet.
Code which is reproduced by changing the variable names, formats, etc.
Therefore, it is recommended that you submit your original solutions in HackerRank's assessments.
View ArticleThe General Data Protection Regulation (GDPR) is a new EU regulation that aims to improve privacy and give greater control to customers over their personal information and how it is used.
We have brought together a collection of frequently asked questions on the new General Data Protection Regulation (GDPR)
GDPR FAQs
What is HackerRank's role in GDPR?
HackerRank for Work is a Data Processor as HRW processes data on the direction of customers, who are Data Controllers
What Types of Personal Information does HackerRank collect?
Among the types of Personal Data that the HackerRank for Work collects, by itself or through third parties, there are Cookies, Usage Data, geographic position, email address, first name, last name, username, password, company name, etc.
Certain data elements requested from customers could be mandatory without which it could be impossible for HackerRank to provide service to you while for non-mandatory data elements,you may choose not to provide the requested data without any consequences to the availability or the functioning of the Services.
What is HackerRanks privacy policy?
We, at HackerRank, take Privacy issues seriously and want you to be familiar with things like the collection of data, data usage, disclosure information, etc.You can access HackerRank's detailed privacy policy over here.
How can I delete the data of a particular candidate?
Follow the below steps to delete a Candidate's profile.
Go to Candidates tab inside a Test.
Click on the vertical ellipsis menu on the right side of a candidate's attempt and click onVisit Profile
Support Request form
From the candidates profile page, click on the vertical ellipsis and select optionDelete Profile
On clicking theDelete Profileoption, you will get a warning message mentioning that the deletion of the profile of any candidate is an irreversible action. ClickYesto continue.
Once a candidate's profile is deleted you get the confirmation message on the screen, mentioning the same.
How can I delete candidate data in bulk?
For the deletion of candidate data in bulk, you need to raise a request to [email protected]. You can also raise a request using our Support Request form.
Alternatively, if you have a Customer Success Manager or Account Manager assigned to you, you may route the request through them.Once your request and the list of candidates to be deleted is received, HackerRank will anonymize the data within 14 days. You will be notified once the deletion is complete.
Can deleted data be reinstated?
No. Once candidate data is deleted, it cannot be reinstated.
How can I download candidate data?
HackerRank for Work offers 3 primary ways to download candidate's data.
Download candidate data from a Test
Download candidate data from aCodePairinterview
Download / Export candidate timeline
1. Learn more about downloading reports of candidate'stestperformance from our support articles: Downloading PDF and Excel Test reports and Viewing a Candidate's detailed Test report.
2. Learn more on how to downloadcandidatedata from aCodePairinterview from our support article: Viewing a CodePair report.
3. You can export or download the candidate's data following the below steps.
Go to theCandidates tab inside a Test.
Click on the vertical ellipsis menu on the right side of a candidate's attempt and click onVisit Profile.
From the candidates profile page, click on the vertical ellipsis and select optionExport Profile.
Once you click onExport Profile, thecandidate's data will get downloaded in a portable format.
Does HackerRank share candidate data with other third-party services?
HackerRank for work does not share or distribute customer data except as provided in the contractual agreement between HackerRank and customeroras may be required by law. For more detail on our data sharing policy please refer to our Privacy Policy.
Does HackerRank maintain an audit trail of events?
HackerRank maintains an audit trail of all user events. You can retrieve the audit logs using our API. You can also raise a request to [email protected] or submit the same using our . If you have a Customer Success Manager or Account Manager assigned to you, you can also route the request through them.
Does HackerRank allow a candidate who took a HackerRank test, edit / delete their personal data or test attempt?
HackerRank for Work is a recruiting platform where recruiters conduct tests and coding challenges to hire developers. Companies or recruiters directly own the tests and HackerRank doesn't have any control over the same. For deletion or update of personal data or test attempt, the candidate needs to contact the company who administered the test directly.
Can a candidate who took a HackerRank test download their test data?
HackerRank for Work doesn't allow candidate to download their test data directly. As a recruiting platform we let companies administer coding challenges and help them with their interview process. Candidates need to contact the company who administered the test if they want to download their test data.
View ArticleCustom Tests are Tests designed by Recruiters in HackerRank to suit their specific hiring requirements. You can build a Custom Test to include Questions that assess Candidates for a specific job Role, experience and skill level. You can create new Questions and add to your Custom Tests. Alternatively, you can also include Questions from the HackerRank built-in Library or your company Library.
Example: You want to hire Quality Assurance Engineers with 5 years of experience and skills to build optimal Test automation scripts. You can build a Custom Test for this Role, and create relevant Questions to build the Test. Assess your Candidates based on the optimal solutions provided for each Question in the Test.
PrerequisitesYou must be logged in to your HackerRank for Work account.
Steps1. Navigate to Tests. Click Create Test.
Sharing a Test for Benchmarking
Option to create a Test
2. The Create a New Test window is displayed.Select the 'Build your own Test' option, and specify the job role, work experience, Test name and duration of the Test in minutes. Provide an optional link to a website or page where Candidates can refer the detailed job description.
Note: Your Tests must include a specific time duration.
New Test window
3. Click Create Test.A new Test is generated, and the Questions tab lets you add Questions from the Library or create your own Questions as shown below.
The Questions page
4. Click Add from library to add Questions from the HackerRank Library. The list of all Questions in the Library is displayed.
The HackerRank Library Page
5. Select the Library from which you want to add Questions.
The Hackerrank questions category lists all the readymade or built-in Questions from the HackerRank Library. The My company questions tab lists all the Questions created by you or other Recruiters in your HackerRank Team.
Note: You can only add Questions from your company Library if either you or your Team has created the Questions.
6. In the left navigation pane, perform the following steps to view the list of the most relevant Questions:
Select the Question type from the drop-down menu to narrow the results.
Apply the filter tags based on your Question type to find relevant Questions.
Use the search window to search for the relevant Questions.
All Questions are listed in the right pane.
7. Click the plus sign (+) to add the particular Question to the Test. You can add multiple Questions to the Test.
8. After adding the required Questions, click Go to test. The Questions page lists all the Questions you have added.
9. You can perform the following operations on this page:
If you want to view a Question, click the Question title to view the complete description. Alternatively, the View option enables to view the entire Question.
Click the Insights button to view the insights and statistical data on the usage of a specific Question. The Insights give useful information such as the number of times a Question has been attempted, median attempt time for a Question, and median attempt time for the full score.
Options to view the Question and Insights
10.If you do not find any relevant Questions in the Library, HackerRank for Work gives you the flexibility to add your own Questions. To create new Questions and add to the Test, click the Plus sign at the bottom left side corner, and select Create question.
Refer Create a New Question for more information about creating different types of Questions.
11. You can also organize the Questions in your Test under various logical categories called Sections. Click the Plus sign, and select Create section. Refer: Section Based Testing for more information.
Option to create new Questions and Sections
12. Before publishing a Test, it is recommended that you validate the Test. Refer for more information.
Note: You do not need to save this Test. All the Questions that you added to this Test are auto-saved.
The Custom Test is created and listed in the Tests home page.
View ArticleYou must send an email to [email protected] from the accountthat you want to change to request for the email account change. Once we verify that you have access to the email account, we can change the email address for you.
View ArticleHackerRank's Test reports provide a detailed view of a Candidate's performance and scores achieved in a Test. After your Candidates have attempted a Test, you can view their detailed performance Report and also download their reports inPDForExcel formats. You can use the downloaded reports to share with external evaluators or recruiters, or you can use them to simply maintain a record.
Note: You can only download the Test Reports of Candidates who have attempted the Test.
PDF Test Reports
For a given Test, you can download the individual Test Reports of all the Candidates in separatePDF files. The PDF Report for a Candidate is a replica of detailed Test report and contains all questions, answers, evaluation details and scores.
Refer to the Viewing a Candidate's Detailed Test Report topic for more information about detailed Test Reports.
Excel Test Reports
The downloaded Excel Report includes the performance report of all Test Candidates in a single file. Through the Excel Report Preferences settings in HackerRank, you can choose the Candidate performance data you want to download in your Excel file.
Prerequisites
You must have a HackerRank for Work account.
You must have at least one Test which Candidates' have attempted.
Steps
Navigate to Tests and select the required Test.
Click the Candidates tab. You will see the list of Candidates with their different Test statuses indicated in the Status column.
Report preferences
Candidates' statuses in the Test
Downloading the PDF Test Reports of Candidates
In the left pane of the Test Candidates tab, expand the Candidate Statuscategory and select the Completed option. The right pane lists the Candidate entries who have attempted the Test and are pending Evaluation, Passed or Failed the Test.
Click Download, and select PDF to download all the Candidates' Test Reports.
- OR -
Select the required Candidates, click Download and select PDF to download specific Candidate reports.
The process downloads a folder containing separate PDF report files for every Candidate.
Note: Although the PDF Test report includes the candidate's detailed answers to all Questions, for a thorough evaluation, you must use the detailed report view in HackerRank which includes capabilities such as code playback, compilation, rendering, and download.
Downloading individual PDF reports of Candidates
Downloading the Excel Test Reports of Candidates
Before downloading the excel report, ensure that you have set the required.
In the left pane of the Test Candidates tab, expand the Candidate Statuscategory and select the Completed option. The right pane lists the Candidate entries who have attempted the Test and are pending evaluation, Passed or Failed the Test.
Click Download, and select EXCELto download an excel report file with the performance details of all the Candidates.
- OR -
To download the performance report of specific Candidates, select the required Candidates, click Download and select EXCEL.
The process downloads a single Excel file containing the candidates' performance data.
Downloading an excel file report of Candidate test performance
View ArticleYou can set up your report preferences for the Microsoft Excel sheet reports generated for the candidates. These reports can be downloaded from the reports page. The preferences you set here are reflected in the Microsoft Excel sheet reports you download.
Prerequisites
You must be logged in to your HackerRank for Work account.
Steps
Click the arrow next to the user icon on the top right corner of the home page. Click Settings from the drop-down menu and then click Report Preferences in the left navigation pane.
Test report settings
In the displayed page, click the corresponding button to enable the required options:
Show score for question and tag: If this option is enabled, then the Microsoft Excel sheet report displays the cumulative score for each question and each tag
Detailed question analysis: If this option is enabled, then the report displays the detailed question analysis, includingthe lines of code, number of times the code was compiled for a given question,score for eachtest case, multiple choice answers, etc
Show candidate feedback: If this option is enabled, then you can see the feedback given by the candidate at the end of the test
Note: By default, all these options are disabled.
Click Save.
View ArticleThe HackerRank for Work Test platform allows different Candidates to log in and attempt their respective Tests simultaneously. Our platform may sometimes experience an unprecedented volume of Candidates taking different Tests at the same time.
To ensure a good Test experience, the platform has a particular limit on the number of Candidates allowed to attempt HackerRank Tests at a given instant, and in a scenario where the specified limit of test takers has exceeded on the platform, a Candidate may not be able to log in to a Test.
When the HackerRank Test platform is at capacity, the following message is displayed if you're trying to log in to your Test. Note the hiring company's scheduled time window for completing the Test.
Candidate alerted when the HackerRank Test platform has too many Test-takers
This is usually a temporary situation. We recommend:
You try again after some time -providedthere is sufficient time leftin the Test schedule.You should be able to log in and start your Test when the situation eases on the platform.
Contact your hiring manager -if the Test schedule ends soon and you are running short of time.
Contact the recruiter or the hiring company who originally sent you the Test invitation and inform them about the situation.
You can open the received Test invite email and click "Reply All" to send your query or request to the concerned recruiter(s) in the hiring company.The hiring firm would typically be included in the e-mail when you click "Reply All" and we'd defer to them to respond to your request.
Replying to the hiring manager or recruiter in the company
Note: If you are a Recruiter who has Candidates trying to take Tests on the platform, contact our Customer Support via .
View Article(If you are a Recruiter using HackerRank for Work and looking for information about Test Cases, refer to the Defining test cases for coding Questions topic. )
In your HackerRank Coding questions, test cases help your test setter to validate your coding logic to address all the different scenarios in a problem and verify your output against the expected output. Test cases can be categorized as Sample and Hidden test cases.
Sample Test Cases
Sample test cases are those which are executed first when you run your code. Their purpose is to carry out an initial validation of your coding logic over simple use cases and verify your output against the exact expected output.
To help you gain a better understanding of the problem and the type of input and output expected from your coding logic, your test setter may include one or more sample test cases in your coding question.Only the Sample test cases display the execution result along with the particular input values, the output from your codeand the expected output.
Example
For a coding logic to return the sum of two integers, following is the Sample test case execution status in a HackerRank coding Test.
download the sample input and output values
Sample test case execution status with input and output values presented
Tip: You can also for a coding Question from the output area in your Tests as shown in the illustration below. The input and output values will be available in separate files.
Downloading sample input and output values
The Sample test cases may or may not involve a score for successful execution. In many cases, these are included for your better understanding of the problem and initial validation of your coding logic.
View Article( If you are a Recruiter using HackerRank for Work and looking for information about Test Cases, refer to the Defining Test Cases for Coding Questions topic. )
Hidden test cases include your test setter's corner cases or different scenarios defined to validate your coding solution. These test cases check whether your solution addresses the problem including its various constraints, but do not display the expected output of the test case.
For instance, the hidden test cases may be defined to validate your coding logic against boundary values, error handling scenarios, etc.Depending on the complexity of the coding Question or for specific skills assessment, your test setter may include one more hidden test cases for your question.
When you click Run code, the hidden test cases execute and display only the status as "Success" or "Wrong Answer" depending on whether the output from your code matches the exact expected output of the test case. The input and output values of these test cases are hidden.
Typically, each hidden test case in a Coding question may include specific scores for producing the exact expected output.
In the following example, the Hidden test cases have executed successfully and the output is hidden.
Failed test cases and wrong answer status
Hidden Test cases of a coding question
Tip: If your Hidden test cases are failing with a "Wrong Answer" status, it may indicate that your logic is not able to handle corner scenarios and provide a complete solution to the given problem. You can debug your code using the Test against custom input option and analyze the issue with your logic.
For detailed information about test cases in coding questions, refer to the following topics:
Test cases in your coding Question
Sample test cases
View Article