
It’s not what you think, exactly, but close. I have been interviewing again, this time for a full time position. During my search, on one of the interviews, I was asked to use the PEX coding for fun website to flex my programming muscles.
If you don’t know about the Microsoft Research project, you can get more info at PEX. Pex finds interesting input-output values of your methods, which you can save as a small test suite with high code coverage.
So Pex basically creates unit tests by sending in arguments to a method and compares the results to the expected output. It’s a neat piece of software. Here was my code challenge:
1 2 3 4 5 6 7 8 | |
When you run it, Pex tells you the x parameter value and if the return value was correct. My solution was x * ((x * 2) - 1). Not too hard, but my interviewers threw me a curve ball when they also gave me the windows calculator on the scientific settings. I thought it was going to be some MOD square root nonsense.
I was really impressed with this approach to interviewing and the use of PEX. It might have been simpler to code up some unit test to a console program but the geeky-ness of their solution won me over. I was offered the position but did not accept it.