Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have an interview question:

step 1: the candidate is shown the specification for a method and the results of running the test suite on an obfuscated version of the method. All tests pass. The test suite is minimal, and test coverage is abysmal.

step 2: the candidate is asked to come up with more test cases, based on the specification. The code is run against the updated test suite - most new tests will fail because the method's implementation has several known bugs.

step 3: The un-obfuscated source is provided and the candidate is asked to correct any bugs they discover.

step 4: the changed source is run against a full test suite.

I like this because the candidate's ability to think of test cases, debug, and fix existing code are all tested for.



This has failed me because code get pretty gnarly fast, many things I thought was obvious was missed by people smarter than me. I think as long as it is a tool for discussions rather than grades it is good though.


Curious if any interviewee has tried to unobfuscate the code.


Do you allow property based testing?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: