(If you are a Recruiter using HackerRank for Work and looking for information about Test Cases, refer to the Defining Test Cases for Coding Questions topic. )
Hidden Test cases include your test setter's corner cases or different scenarios defined to validate your coding solution. These test cases check whether your solution addresses the problem including its various constraints. For instance, the hidden test cases may be defined to test your logic against boundary values, error handling scenarios, etc. Depending on the complexity of your coding Question or for specific skills assessment, your test setter may include one more hidden test cases for your question.
When you run your code, the hidden test cases execute and display only the status of the test cases as "Correct Answer" or "Wrong Answer" depending on whether the output from your solution matches the exact expected output. The input and output values of these Test cases are hidden.
Typically, each hidden test case in a Coding question includes specific scores for producing the "Correct Answer".
Note: If a coding question includes Sample Test Cases, then its Hidden test cases are executed only when all the sample test cases have passed to produce the exact expected output.
In the following example, the coding solution to find the sum of integers has executed successfully to produce the exact output for the sample test cases. Therefore, the Hidden Test cases have also executed and display the status.
Tip: If your Hidden Test cases are failing with a "Wrong Answer" status, it may indicate that your logic is not able to handle corner scenarios and provide a complete solution to the given problem. You can debug your code using the Test against custom input option and analyze the issue with your logic.
For detailed information about Test cases in coding questions, refer to the following topics: