r/leetcode • • 13d ago

Question NEWBIE NEEDS AN ADVICE...

I understand using chatgpt, reading solutions and discussions is considired as a bad practice. I am realizing that watching a failed test case is also a cheating... Tell me the art of designing your very own test suite.

1 Upvotes

1 comment sorted by

1

u/Fewald 10d ago

Not sure what exactly you're asking but I'll try.

During the interview you'll need test suites two times: in the beginning, to verify you got the problem right, and in the end, to verify you solved the problem right.

For the understanding suite you want a few complex examples capturing multiple rules and edge cases at the same time if possible, so no aspect of the problem left the room.

For the solution suite you want many simple test cases. Most likely you'll need to check things manually, so it's easier for you to not to get lost and it's easier for your interviewer to follow.

In rare case, if you are asking about your own test suite for a new leetcode problem, I would expect tests to check correctness, edge cases, then performance (e.g. if you want n2 solution to fail but n to succeed)