Frequently Asked Questions
General Questions
What is HackerRank?
HackerRank 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.
Why should I solve challenges?
For Fun. What's more exciting than solving challenging problems? We're constantly adding helpful features to make our platform the best possible experience, such as boilerplate code and animations that display when you're running code.
Jobs. Looking for a job at an awesome company? You can get hired by solving challenges! See our Jobs page for details.
Glory. As you solve more challenges, you earn points and move up the HackerRank Leaderboard.
Community. We're constantly growing our strong community of developers who discuss problems, learn, compete, and collaborate together.
Learning . Expand your knowledge by learning new programming topics and techniques by going through our challenges and editorial solutions. We believe the best way to learn something is by doing it! Have a look at our Tutorial domains.
And More!
Can I use HackerRank to earn money or get a job?
Yes! 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.
How do I create challenges on HackerRank?
Check out our challenge creation guidelines to make your own private challenges. Once you're familiar with our platform, we're always looking for talented problem setters and testers! Apply to be a paid contributor here.
Can I create my own contest?
Yes! Create custom contests using HackerRank challenges, or write your own original content. Check out our challenge creation guidelines and start competing with your friends!
Challenge Details
Which Computer Science domains do your challenges cover?
Our 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!
How does scoring work?
Check out our Scoring Documentation for a comprehensive overview of how we score different types of challenges and determine leaderboard positions.
How do I write my code?
Each 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!
How do I test and submit my code?
When you finish the first version of your code, click Run Code button to run your solution against one or more small sample test cases. Once you're confident your solution covers the entire problem, click Submit to 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.
How do I debug my code?
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's Expected Output (so printing debug statements there could cause you to fail the challenge). If your submission language supports printing to STDERR (e.g., cerr
for C++, System.err.println
for Java, console.error
for JavaScript, etc.), you can send your debug output there and it will show up in a separate Error box underneath the challenge's Expected Output.
Can my code write to a file?
Check out the Writing State Information to a File tab on our Environment page.
What happens after I submit my code?
We 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 a O(2n) solution when n = 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.
Are there any shortcut keys?
There 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
Contest Details
What 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.
Typical Forum Questions
Why does my code work fine on my machine but not on HackerRank??
If 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 a Discussions tab 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!
I passed the sample test cases but am failing the additional test cases!
Try 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 the Discussions tab to see if somebody else hit the same stumbling block or ask for help from others who've completed the challenge.
I don't understand the problem statement, what should I do?
Read the statement a few more times, and check the Discussions tab 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.
Settings Page Questions
How do I change my email associated with HackerRank?
If 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 the Delete Account feature on the Account Settings page.
Add the new email ID to the Email Addresses section 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 as verified on the settings page. You will also have an option to "Make primary". Click on that option.
I have created two accounts. Can I merge them?
If you have two accounts that you wish to merge, you can use the Merge Account feature 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