Adding Test Cases

A test case is an input and output for a programming question, which allows you to validate the candidate's code.

Let’s say that we want the candidate to write a function/method that adds two numbers. In this case, the test cases could be something like this.

Test case 1

Input: 10, 20

Expected output: 30

Test case 2

Input: 30, -5

Expected output: 25

Test case 3

Input: -30, -40

Expected output: -70

Test case 4

Input: 35, abcd

Expected output: Input value is not a number

Creating a New Test Case

  1. While creating a new question, or while editing an existing one, click on the “Add test case” button on the Test Cases step.

  2. In the Add Test Case pop-up, define the test case's name, score, input, and expected output.