Saturday, April 21, 2018

Being an interviewer: Sudoku solver

April 21, 2018

Introduction


It is my 10:00 AM mock interview. The peer worked on Sudoku solver, and then he chose swift language. What he did is to check given numbers on the board are following the rules - row/ column, small grid 3 x 3 matrix not duplicate.

The code he wrote for preprocessing is kind of buggy, so we started to talk and communicate on this piece of code. And then I told him that most of people do not do this preprocessing.

The interviewee wrote code but could not pass the test case, and then I walked through the code, and pointed out on line 18, variable name i is used the second time.

Code review 


Here is the swift code I reviewed for the peer as well. The code passed all test cases.

I gave the advice to write readable code, use meaningful variable names, and also I advised the peer to communicate more with the interviewer. I told him that I met a young master graduate, who was preparing Google onsite, and then he got offer. When I mocked interview him, he kept asking me "am I in right check", "do you think that my coding looks ok", he has determined goal, to write code to pass all test cases he prepared, he likes to develop a complete solution in less than 30 minutes.

I had a small chat with the peer who is preparing Uber phone screen. The peer got the Amazon offer but chose another offer a few years ago. Interesting story, a small world, stay anonymous, smart and hard working young programmer.



No comments:

Post a Comment