Saturday, January 13, 2018

Root of a number

January 13, 2018


Introduction


It is so interesting to meet an engineer and I can compare to the peer's performance. What we discussed in the mock interview at the very beginning is about lower bound and upper bound. For example, given x = 7, n = 3, how to define an upper and lower bound fitting for most of x >=0 and n >0 as integer?

We have to define it to apply two case, one is x < 1 and x > 1. The good range is [0, Math.min(1, x)]. The thing I can learn from the peer is the way the peer communicates, and how easy he is to be able to communicate. That is something I can learn.

Of course the peer has not practiced the algorithm over ten times in last six months as I do. But let us look at his code and see how good it is.


Code review 


Here is the C# code.


No comments:

Post a Comment