You can create coding Questions to test the most relevant skills of the Candidates. By creating Questions that require Candidates to write real working code and not just pseudocode, you can ensure that Candidates have the required skills for the role.
- You must be logged in to your HackerRank for Work account.
1. Click the Library tab on the home page and then click Create Question.
2. In the Select Question Type dialog box, click Coding.
3. In the Problem Statement page, specify:
A. Problem Name
The problem name should be short and topical. It should not give any hints to solve the problem.
Tags are words or phrases that help with searchability and organization of your questions. You can add the existing tags or create new tags and set the difficulty level for your Question by associating the tags as Easy, Medium or Hard. Alternatively, associate custom Tags to identify your Question by its complexity or levels.
a. Click the Tags drop-down, and type a keyword. Example, Easy.
b. Click Add, the “Easy” tag is associated with the Question.
When you view your Questions in the Library, the associated tags will be indicated for every Question. You can use these Tags to generate candidate reports and performance graphs.
Refer Setting the Difficulty Level for Questions for more information.
C. Problem Description
A good problem statement should comprise a clear and detailed problem description, at least one sample test case with an explanation, and constraints of the problem.
Refer to the Coding question: problem statement topic for more information.
D. Internal Notes
Internal notes are for later reference. You can include a rubric about scoring the questions or write solutions to the problems in this section. These can be used by your team while evaluating the test. This step is optional.
Note: Internal notes are only visible to your team and you.
You can support your problem statement and internal notes by attaching a relevant reference file in these sections. Refer to the How to Attach a File to a Problem Statement topic for more information.
E. Click Save & Proceed.
4. In the Languages page:
A. Click Clear all and then select the check boxes for the allowed languages to answer this particular problem.
B. In the Code Stub section, specify the function name, return type, and optionally add function parameters and then click Generate Code to generate the code stub.
Generating Code Stubs
Refer to the Coding question: code stub topic for more information.
Step Result: A dialog box is displayed that lists the languages for which auto-generated code stub is not supported.
Programming languages for which Code Stubs are not supported
This dialog box is only displayed if your allowed languages include one or more unsupported language for automatically generated code stub.
C. In the displayed dialog box, you can either choose to deselect the unsupported languages for automatically generated code stub or keep these languages and then click Yes, Generate Code.
If you deselect the languages, then those languages are not allowed for answering this question. If you keep these languages, you have to manually select the language in the Default Stub section and type the code stub.
Step Result: In the Default Stub section, you can select the languages from the drop down menu to see the generated code stub.
D. Click Save & Proceed.
5. In the Test Cases section of the displayed page, perform one of the following operations:
A. If you want to add test cases one by one, click Add test case. In the Add Test Case dialog box:
i. Specify the name of the test case.
ii. Select the difficulty level of the particular test case.
iii. Enter a score for this test case. If the code passes this particular test case, this score is assigned. The sum of scores of all test cases is the total score assigned to a coding question.
Note: You must assign a score to a particular test case, depending on the difficulty level of the test case.
iv. Specify the input and expected output values for the test case.
v. Optional: Select the Mark as sample test case check box if you want this case to be a sample test case.
vi. Click Save.
Repeat the steps illustrated in 5A to add more test cases.
Refer to the Coding question: test cases topic for more information on test cases.
B. Click Upload as .zip to upload multiple test cases.
i. In the Upload Test Cases dialog box, click Choose File to upload a zip file that contains test cases from your local system.
ii. Click Upload to upload the zip file.
This method is preferred when either the size of input and output is large, or the number of test cases is large. The input files in the zip are named input000.txt, input001.txt, and so on. The output files are named output000.txt, output001.txt and so on.
iii. Click + Add test case to add a test case for the problem. In the displayed dialog box:
iv. Click Upload as .zip.
6. Click Save Question to save the question and exit.
7. Alternatively, click Save & Add another to save this question and proceed to create another one.
8. The Questions you create are stored in the HackerRank Library under the “My Company questions” section. The Question type and the associated tags are indicated below every Question title as shown below.
While in the Library, you can proceed to create more questions or add Questions to your Tests.