In your HackerRank Coding questions, test cases help your test setter to validate your coding logic to address all the different scenarios in a problem and verify your output against the expected output. Test cases can be categorized as Sample and Hidden test cases.
Sample Test Cases
Sample test cases are those which are executed first when you run your code. Their purpose is to carry out an initial validation of your coding logic over simple use cases and verify your output against the exact expected output.
To help you gain a better understanding of the problem and the type of input and output expected from your coding logic, your test setter may include one or more sample test cases in your coding question. Only the Sample test cases display the execution result along with the particular input values, the output from your code and the expected output.
For a coding logic, following is the Sample test case execution status in a HackerRank coding Test.
Tip: You can also download the sample input and output values for a coding Question from the output area in your Tests as shown in the illustration below. The input and output values will be available in separate files.
The Sample test cases may or may not involve a score for successful execution. In many cases, these are included for your better understanding of the problem and initial validation of your coding logic.