HackerRank supports Microsoft SQL, MySQL, Oracle, and DB2 databases.
Creating a Database Question
- Click on the Library tab on the home page and then click on the Create Question button.
- In the Select Question Type dialog box, click on Database.
Steps
There are two steps in creating a database question:
Step1: Question Details
Here, you will be asked to give the basic details of the question you are creating.
The fields include:
A. Problem Name
The problem name should be short and topical. It should not give any hints to solve the problem.
B. Problem Description
You must describe the data schema with which the candidate will be working and explicitly state any constraints. Also, indicate what data has to be retrieved for this problem.
C. Score
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.
Score | Question Type |
50 points | For an easy question that can be solved in 15 minutes |
75 points | For a medium question that can be solved in 30 minutes |
100 points | For a difficult question that can be solved in 45 minutes |
D. Recommended Time
It is the time that you give the time you want the candidates to spend on answering this question.
E. Tags
Tags are words or phrases that help with the search ability 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 on the Tags drop-down, and type a keyword. Example: Easy.
b. Click on the Add option. 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 to the Setting the Difficulty Level for Questions for more information.
Click on the Use content templates option to use the predefined HackerRank's database question template to define your problem clearly.
Refer to the Defining the Problem Statement: Coding and Database Engineer Questions topic.
Tip: Specify the table definitions with any constraints
F. Interviewer Guidelines
Interviewer guidelines are used for later reference. You can include a rubric about scoring the questions or write solutions to the problems here. These can be used by your team while evaluating the test. These are only visible to your team and you; however, candidates cannot view these notes.
You can support your problem statement and Interviewer Guidelines by attaching a relevant reference file in these sections. Refer to How to Attach a File to a Problem Statement for more information.
Click on Next to continue to Step2.
Step2: Database Setup
On the Database Setup page, select the checkboxes for the databases that candidates can use to solve this problem.
On the tables section you can Upload schema as a file in SQL or CSV format. You can also edit your table.
You can also select the schema specific to DB by using the DB specific schema toggle.
Once you have uploaded a file it will be automatically validated. You can also initiate the validation by clicking on Validate Schema.
In case of a failure in validation you can click on the details to detect the errors in your schema.
Once you are done validating successfully, click on the Save Question button to save the question in your My Company Library.