Saturday, January 27, 2018

Use bit manipulation to solve problem of power of n

January 27, 2018

Introduction


I really like Roger Federal as a professional tennis player, but I never have any chance to talk to him. But do not worry, today I had a chance to talk to a programmer from Switzerland, he speaks exactly same as Roger Federal does, a Switzerland accent. And he also tried to teach me the algorithm called power of n using bit manipulation.

I did some research after mock interview. Here is one article about the detail.

I just could not believe that I got best help from top programmer through mock interview this weekend.

Here is the algorithm the peer wrote. The great thing is to watch him how he did the testing using 52 and then after the testing, he cleaned up the white board testing code. He just quickly demoed how he wrote a new code and also tested and put it in the production, nicely presented after removing those test cases.



No comments:

Post a Comment