Guide for Using Test Cases

This document is for technical interviewers who want to setup test cases alongside challenges for take-home projects

Test cases works alongside CoderPad’s Challenge Library (available for Business and Enterprise plans). It allows interviewers to assess the completeness of a candidates work, and allows candidates to better understand the desired solution.

An example: let’s say that we want a candidate to write a function that reverses a string. With Test-Cases, I can write function inputs, for example “Hello World”. And then we can provide the given output that the function should return. In our example the return value expected would be “dlroW olleH”. Here is how to set test cases alongside your challenges.

Create a challenge WITH test cases

The link to Challenges can be found in the left sidebar from your dashboard. There are two types of Challenges that you can create. A Challenge WITH test cases, and a Challenge without test cases. Click on the button in the top right of the Challenges area “Create New Challenge with Test Cases”.

Add Challenge details

The title, default language and internal description

To keep your library well organized, we recommend coming up with a schema for the title of your questions. An example: “[Junior Java Engineer] – Find the most frequent element in an integer array”. There is no strict schema – just find something that works for your team and stay consistent, especially if sharing questions. You can also select the default language to be used for the question, and add a description that can be used to document anything your team may need to know about the Challenges.

Custom Files

You can also attach custom files to your question. CoderPad’s Custom Files feature allows an interviewer to test a candidate’s ability to manipulate data, navigate a file system programmatically, and prove their expertise in a system very similar to what they’ll encounter on the job.

Add Test Cases

Function Signature

For test cases, you need to provide the data types for the parameters and return value of the given function. You can have multiple parameters for the given function, and specify the return value.

Test Cases

Below the function signature, you can add individual test cases. These can be used to showcase what should be returned given a valid input. You can provide as many arguments as you see fit, and you can also choose if you would like them to be visible to the candidate. Once the candidate has submitted their challenge, you will be able to review every test case you have provided.

The given arguments must match up with the type of parameters specified in the function signature.

Create a Take-Home Project with your Challenge and Test Cases

To create a take-home project with the challenge that you have created, simply go to the Challenges page by clicking on Challenges in the left sidebar. From there, simply select the Challenge that you created and press the “Create Take-Homes” button.

To create one take-home project, simply enter the name of the pad in the first input, specify the time limit of the challenge in the right column, and then press “Create Take-Homes and Get URLs” button. If you would like to create multiple pads using this Challenge, click on the “Add Take-Home” button, and enter the name of the pad in the following inputs.

On the next page, we provide you with the unique URL for each interview. Use these URLs to send to the candidate ahead of their take-home project. You can also access these pads at any time from your the main pads page.