Creating DevOps questions

You can do the following to create a DevOps question in a test:

1. In a test, click Add questions. You will be redirected to the questions dashboard.


8.png

2. Click Create a new question.


9.png

3. Select DevOps as the question type under the Project section.


10.png

You will see three sections which are as follows:

  • Description: In this section, you need to enter the Problem name, Problem statement, Difficulty level, Maximum score, and Tags related to the problem. For example, In this problem, the candidate has to create a dockerized Python web application and maintain a hit counter in Redis.

11.png

 

  • Environment: In this section, the environment of the problem is set up. For now, HackerEarth only provides support for Ubuntu 20.04, but soon, we will be providing support for other environments such as RHEL and Windows.
  • Scripts: In this section, you have to enter the Configuration script and Validation script. Click Next to continue.

4. Select the Operating system you want to choose. Currently, the platform supports Ubuntu 20.04, but soon HackerEarth will be introducing new environments such as RHEL and Windows.

12.png

5. Now, you have to enter the Configuration script and Validation script. This is the most important part as a DevOps project question relies on two scripts for setting up the question and for evaluating candidates' submissions.

13.png

The two scripts are as follows:

  • Configuration script: This script is used for setting up the server setup and is run during initialization before the candidate starts attempting the question. Here, you can install any packages/dependencies that the question needs or create files for the candidates to interact with. This script is run in the backend during the server startup time before the candidate solves the question.

    1. Supported Format - .sh

    2. Timeout limit - 5 minutes maximum

  • Validation script: This script assigns scores and evaluates the candidate's submission. It evaluates each test case and outputs the result.

    1. Supported Format - .sh

    2. Timeout limit - 2 minutes

In the case of our question, the configuration script downloads and installs docker and docker-compose as shown below:

14.png

6. After uploading the scripts, click Publish to save and publish the question.

Your question is now ready to use. To learn about the scoring of DevOps questions, refer to this article.

15.png

Note: Make sure you check your question after publishing by clicking Try Question. The configuration script often has errors that can result in the machine not spawning in the candidate interface.

You can also watch this video to understand how to create a DevOps question.