Sunday, January 14, 2018

Root of a number

January 14, 2018

Introduction


It is such a great machine learning algorithm on mock interview platform. I spent 50 minutes with a top ranking university with highest GPA, a master student to work on a problem solving. Quickly in less than 20 minutes the solution was written and also pass almost all test cases. I was amazed by the peer the engineering power, the way he tested the code, and the quick he applied to small increment value from 0.001 to 0.0009 to 0.0001, and also the answer he gave to me why it is good idea to always increment or decrement one value.

I have worked on the algorithm through mock interview near 10 times, I never came cross this idea to apply increment/ decrement the middle value one but just simply apply the value from 0.001 to 0.0001.


Code review


Here is the code written by the peer using C++. I like to code review later on.


No comments:

Post a Comment