0

Code Coach Hidden Tests

Hello all. Just for curiosity, why most Test Cases are not visible when solving a Code Coach challenge?

25th Aug 2024, 7:54 AM
Ruben
3 Réponses
+ 4
It's to make the programmers think of "all" solutions, not just what they can immediately see/think of. Take a simple calculator, for example. You need to add any 2 numbers, so if the programmer only thinks of 2+2, the programmer isn't thinking of the infinite possibilities of the sum. I wrote a code that kind of illustrates this idea too: https://sololearn.com/compiler-playground/c2H9u8pFNj7t/?ref=app
25th Aug 2024, 8:22 AM
Ausgrindtube
Ausgrindtube - avatar
+ 3
Hey! The hidden tests in Code Coach are there to make sure your code works correctly not just on the visible examples, but also on unexpected input. It tests your solution's robustness and versatility, so it doesn’t break under any conditions
25th Aug 2024, 9:40 PM
Melkon
Melkon - avatar
+ 1
Thank you, it's clear to me now. I didn't think as possible that one wants to cheat by reading all inputs and code a specific output for each one of them, but yes it is possible and should be prevented. Thanks again.
26th Aug 2024, 3:17 PM
Ruben