A test case is an input and output for a programming question, which allows you to validate the candidate's code.
Let’s say that we want the candidate to write a function/method that adds two numbers. In this case, the test cases could be something like this.
Test case 1
Input: 10, 20
Expected output: 30
Test case 2
Input: 30, -5
Expected output: 25
Test case 3
Input: -30, -40
Expected output: -70
Test case 4
Input: 35, abcd
Expected output: Input value is not a number