Sunday, February 25, 2018

Spiral matrix algorithm

Feb. 25, 2018

Introduction


It is so exciting to learn some ruby and also learn how the peer wrote the algorithm quickly with only two edge cases mistakes, one is one row and another one is one column case.

Code review


Here is the ruby code I code reviewed.

Most important is to observe how top programmer can find out where the code will fail in less than one or two minutes, and then start to think about the fix. In less than five minutes, we worked together and put the fix together. Amazing speed to fix everything. Only thing I did is to ask the peer to think about one row and one column edge case before he likes to run the web compiler.

Line 26 and Line 32, Line 26 one more checking is added "x_min < x_max"; line 32 "y_min < y_max" is added.


Learning time Sunday day night



The Sunday 8:00 PM mock interview is such a great surprise, I had chance to learn how a top programmer and lead in the medium size team performs so well and work with the interviewer so efficiently on my favorite algorithm Spiral matrix.

Becuase of my super performance as a mock interviewer, I had chance to get to know the peer and then I could undertand how a person works very well in mock interview, he did very well in industry as well.

No comments:

Post a Comment