To add a coding test question, click on Talent Trials in the header and click
 "+ Create".

Enter your question in the text box. 

In the "Select your question type" field, choose "Code". You can also insert sample code in the question portion by hovering over the code editor icon in the text box. This can be used if you want to do a simple multiple choice question that refers to a piece of code.

Once you select the code option, you will have the option to automatically grade candidate code with tests cases.

Automatic grading allows you to add test cases and to assign point values to them. In addition, enabling this option allows candidates to run their code while taking the test and iterate on their solution.

Multiple Language Testing

You can choose to allow candidates to code in one or more languages.

Next, click on "Edit Code and Test cases" to open the code editor. 

We suggest you start by coding the actual solution to your question. You'll be able to save it for reference. Then you can test your solution by adding test cases. Finally, you can then remove or create bugs in parts of the solution so that candidates will need to solve those portions.

The header and footer section should be used to add any code that candidates shouldn't be able to change. Think of these as wrapper code that ensures the code is run-able and grade-able. 

Next, let's add some test cases. Click on "+Add a test case"

You will have two options to choose from: "Autograded test case" or an "Example test case".

An autograded test case affects the score and will be automatically graded. Input and expected output will be hidden from candidates. These are great to test candidates ability to get their solution to output the correct code for accepted input, erroneous input, and corner cases. Since candidates can't see the input for this test, this insures they are thinking about all cases.

 On the other hand an example test case won't affect the question score. These are used primarily to frame the question and illustrate input output by example. Therefore the expected output and input are shown to the candidate. 

Remember you can add multiple test cases in one question.

If you choose an autograded test case, enter the information in the fields and choose a point value for the test case. 

If you want to add an example test case, enter the information in the fields and save the test case.

If you choose more than one language, you will need to add base code and test cases for each language you've added.

Add Sample Code Solution

You can add a sample code solution by selecting the settings gear while in the code editing view. Then click "+ Add a sample code solution". 

If you are using multiple languages you will be asked to add default code for each language. 

You are also given the option to add your sample coding solution. Sample code solutions are the ideal answer that you would expect from candidates. Adding sample code solutions allows storage of a solution for reference and helps us learn about your code conventions. (Don't worry, candidates will be able to see any sample code).

When adding a sample focus on code efficiency, elegance, and modularity. Once you have finished adding the code, be sure to "Save Sample".

Did this answer your question?