You can create a Java project question to test candidates on their ability to code and test a multiple files Java software project. Candidates have to write both the code and the test cases. Candidates can run the code in the browser to test it. We utilize the Maven and JUnit frameworks for Java projects.
- You must be logged in to your HackerRank for Work account.
- Click Library tab on the home page and then click Create Question.
The HackerRank Library page
- In the Select Question Type dialog box, click Java Project.
Selecting the 'Java Project' Question type
- 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.
While you can assign any score you want for the questions you create, we use certain standards for assigning scores to the questions we create that you might find useful.
For an easy question that can be solved in 15 minutes
For a medium question that can be solved in 30 minutes
For a difficult question that can be solved in 45 to 60 minutes
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.
D. Problem Description
A good problem statement should comprise a clear and detailed problem description. Ideally, you should include a class diagram to explain the overall project and describe particular constraints of a problem. You must also provide information about the project structure and how they can run the code to test it.
E. 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.
Note: Internal notes are only visible to your team and you.
You can support your problem statement or internal notes by attaching a relevant reference file in these sections. Refer How to Attach a File to a Problem Statement for more information.
4. Click Save & Proceed.
5. In the Folder Structure page, perform one of the following operations:
A. Click Upload zip file to upload a Java project folder for this problem.
You can upload a folder from your local system for the problem you created. Ensure that the folder you upload contains a Maven project file called pom.xml which contains the metadata about the code, how to execute it, and dependencies of the project.
Note: You must name the zip folder as "project.zip" for it to work. This is valid even if you follow the method mentioned in step 4B to upload the project.
B. Click Download current candidate structure to download the existing default folder. Make changes to the downloaded folder as required, and then click Upload zip folder to upload the updated folder.
A default folder contains files such as a source code folder, a test code folder, and a Maven project file called pom.xml. The Maven project file contains JUnit already set up that candidates can readily use. You must not delete the Maven project file.
6. Click Save Question to save the question and exit. Alternatively, click Save & Add another to save this question and proceed to create another one.
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.