How to Create a Coding Question in Test

TestTrick allows you to create coding questions to assess a candidate’s programming skills using real-world problem statements, multiple languages, and test-case-based evaluation.




Step 1: Open the Coding Question Creator


Go to Step 2: Add Questions while creating or editing a test.

Click the Code question card.

  • A modal will appear asking you to choose between:
    • Coding
    • Database

Select Coding.

The Coding Question Creation page will open.

Add Question Details


  • Enter a clear and concise question title.

Question Description

  • Add a detailed problem statement describing what the candidate needs to solve.
  • Include constraints, examples, or edge cases if required.

Select Programming Languages


Choose one or more programming languages in which the candidate can write the solution.

Available languages:

  • JavaScript
  • Python
  • C++
  • TypeScript
  • C#
  • Java
  • PHP
  • Ruby
  • Kotlin
  • Dart
  • Go
  • Elixir

You can also use Select All to allow all languages.

Define Function Signature

Function Name

  • Enter the function name that candidates must implement.

Return Type

  • Select the return type of the function.

Parameters

  • Add function parameters and select their respective data types.

Can add multiple parameters.


Select Default Language & Generate Initial Code


  • If only one language is selected, it will automatically be set as the default language.

If multiple languages are selected:

  • Choose the initial code language candidates will see first.
  • Click Generate Code to auto-create the function boilerplate for all selected languages.

Add Test Cases


Click Add Test Case.

  • A modal will open where you can enter:
    • Test Case Name
    • Weightage
    • Input Values
    • Expected Output

Save the test case.

Show or Hide Test Cases

  • You can choose whether to show test cases to candidates.

    If hidden:

    • Candidates will only see their output and pass/fail status, not the expected output.

Scoring Configuration


  • Coding questions are automatically evaluated based on test cases.
  • Scores are calculated according to test case weightage.

    You can:

    • Adjust the total score manually if required.

      Mark the question as unscorable if you prefer manual evaluation.

      • Unscorable questions are not included in the average score.

Candidate Experience


  • Candidates write code in the selected language.
  • Their solution is evaluated against test cases.
  • They see execution results and pass/fail status.
  • Hidden test cases ensure fair and secure evaluation.

Summary


Coding questions in TestTrick allow you to:

  • Support multiple programming languages
  • Define structured function-based problems
  • Auto-generate starter code
  • Evaluate using weighted test cases
  • Choose between automatic or manual scoring
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.