Skip to content

Instantly share code, notes, and snippets.

@shashank21j
Last active March 11, 2023 12:54
Show Gist options
  • Save shashank21j/41191d61e59cc53d9dad to your computer and use it in GitHub Desktop.
Save shashank21j/41191d61e59cc53d9dad to your computer and use it in GitHub Desktop.
Guide to Create HackerRank Contest

Setter/Tester tips are shared here -> https://gist.github.com/shashank21j/64830e7e3dab96a2ccb8

Creating a Contest on HackerRank is an easy process which is divided in 2 steps.

  1. Create a Challenge.
  2. Create a Contest.
    NOTE Challenge must be added in a contest in order to test it.

#1. Create a Challenge

##Opening create challenge window

wiki1

  1. Go to the top right corner, click your username and select Administration or Click = > Manage Challenges

  2. Click Manage Challenges Tab or Click = > Manage Challenges

  3. Click the green button "New Challenge" in the top right section.

##Making a New Challenge

Now we have the challenge creator window.

Which has the following sections

####Challenge Name This is the name that will appear for the challenge.
Enter the challenge name, for the challenge you want to create.

####Description A brief intro to the problem statement. Where you briefly define the what the challenge is. HackerRank recommends to write something in this section.

####Problem Statement Here the actual problem statement is written. Make sure you write in markdown Markdown Editor
A good problem statement contains

  1. Description of the problem
  2. Any further Clarifications or Notes, that you feel a person may overlook, or wrongly assume. (Optional)
  3. Input format
  4. Output format
  5. Constraints
  6. Sample Input
  7. Sample Output
  8. Explanation of the sample (minimum 2)

Click Save Once you finish writing the problem statement. This will enable more configuration options that we'll see now.

##Tips on Markdown syntax:

  • Use Capital Letters to denote Variable names.
  • Use double space at the end of line to give line breaks.
  • Use **text** for Bold effect
  • Use _text_ for Italics effect
  • Use Italics for all Variable names and things to highlight.
  • Use back ticks (`) for something that has to be exactly printed in output. E.g. Print YES or NO.
  • Use 4 spaces before each line in Sample Input and Sample Output. This acts as a <pre> tag in HTML.
  • Use &le; &ge; for less than equal or greater than equal in constraints.
  • Use <sub> and <sup> For subscript and super script. Avoid ^ for super script.
  • Don't forget to escape the wild characters *, | , _ etc.

A sample problem statement goes like this

This is an introductory challenge. The purpose of this challenge is to give you a working I/O template in your preferred language. It includes scanning 2 integers from `STDIN`, calling a function, returning a value, and printing it to `STDOUT`.    

Your task is to scan two numbers from `STDIN`, and print the sum A+B on `STDOUT`. 

**Note**: The code has been saved in a template, which you can submit if you want. 

**Input Format**  
Given _A_ and _B_ on two different lines.  

**Output Format**  
An integer that denotes Sum _(A + B)_ 

**Constraints**  
1 &le; _A_, _B_ &le; 1000

**Sample Input**

    2
    3

**Sample Output**

    5

##Tips on LaTeX syntax

  • Latex is available on HackerRank challenge editor and can be used by wrapping the text with $\text{Hello World!}$ for inline latex and $$\text{Hello World!}$$ for new line.
  • All the general latex tags are applicable, some examples below can be tried on HackerRank editor. You can find any latex guide on google and it'll work.
%Determinants  
$$
  \left| {\begin{array}{cc|c|c}
   A_{1,1} & A_{1,2} & \cdots & A_{1,N}\\\
   A_{2,1} & A_{2,2} & \cdots & A_{2,N} \\\
   \vdots & \vdots & \ddots & \vdots \\\
   A_{M,1} & A_{M,2} & \cdots & A_{M,N} \\\
  \end{array} } \right |
$$


% System of Equations 
$$\begin{align*}
g'(E) &= \sum_{k=1}^E g\left(\left\lfloor E/k \right\rfloor\right) \\\
g'(E) &= \sum_{k=1}^E \sum_{i=1}^{\lfloor E/k \rfloor} \nabla g(i) \\\
g'(E) &= \sum_{k\cdot i \le E} \nabla g(i)
\end{align*}$$  

Configuring a Challenge

###Test Cases
Click the tab test cases and for each test cases manually fill up input and output fields or upload input/output files for each test case. Give a score to your test case and save.

Or You can create a zip locally containing two folders input and output and having the files named as input00.txt , output00.txt and so on. And upload the zip.

Add at least 10-15 test cases to evaluate a problem.
Make sure you write 2-3 very simple(few lines) test cases and tick the sample checkbox ahead of them. These sample cases run when the user clicks Compile and Test. These have 0 or very low score compared to other test cases.

Make sure the sample test case given in the statement is added in the testcases and marked as sample.

Tip:- Add variety of test cases, few very basic and rest of them of tougher difficulty. Use weightage wisely

Click Save and move on to Languages

###Language
Here you can

  • Enable/Disable a language.
  • Set Time Limit.
  • Set Memory Limit.
  • Set Template

Note If you are not sure of what you are doing Please do not change the default values.

A quick guide to problem setting will help here

Click Save

Custom Checker

This is an advanced feature and is used only when the output returned from the code is to be further processed instead of plain matching against the expected output.

HackerRank recommends using Python for Custom Checker. A default template/guide for custom checker can be availed on request by sending an email to hackers [at] hackerrank [dot] com

###Flags

These are some checks which you can do once the challenge is ready.

  1. Solved Score. For 1 player game and challenges with custom checkers, this threshold will be used to determine solved or not. This flag is useful for various of statistics although it will not affect any score or leaderboard.

  2. Precision Check For 1 float per line output you can enable a precision check. A value of 0.01 would mean +/- 0.01 error tolerance.

  3. Disable Compile and Test Disables the Compile and Test button in the challenge.

  4. Disable Custom Testcase Disables the custom testcase window for users to try their own inputs.

  5. Disable Submission Processing
    Disables the real time submission processing. (Submissions then need to be processed at the end of contest.)

  6. Disable Submission Disables the submission on Challenge

  7. Public Testcase Test Case become public once the contest is over.

  8. Public Solution One can access all solutions of other participants from the Leaderboard once the contest is over.

  9. Restricted Forum Only the admins and staff can post on forums.

Click Save and your problem is created. which can be accessed from Manage Contest

###Editorial
Use this field to write the editorial and this will be enabled when the contest is over.

#2. Creating a Contest

Before creating a contest you must have a set of challenges prepared. As described in the above section

Opening a create contest window

  1. Go to the top right corner, click your username and select Administration or Manage

  2. Click Manage Contest Tab or Manage Contests

  3. Click the green button "New Contest" in the top right section.

Making a new Contest

###Overview

####Name Name of the Contest.

####Duration Select start and end date of the contest.

####Tagline Write a tag line that describes your Contest.

####Description* Write a description of the contest. Contest details, goals, type etc..

Click Save Contest

Configuring Contest

###Add Challenges

Add all the challenges you have created using this page.
To arrange ordering Drag and Drop a challenge to it's desired order.

Weight is the score of the problem
Binary enables binary scoring, by default users get partial scoring depending on the number of test cases they clear and the weighted average of the test cases.
Dynamic This enables the scoring to be based on number of summations

@ch3ck
Copy link

ch3ck commented Jan 17, 2015

Great. This will help a great deal

@akhilravipati97
Copy link

Is there a way to keep a contest open to only a particular set of people? (Like a contest only for a few students of my college)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment