A brief tutorial on the square root of two calculation and digit counting in hexadecimal base.

Recently our software development team recruited a new team member and we had to concoct a home exam in order to filter out less than suitable candidates. Oddly enough, none of our candidates passed the test. Therefore, we wanted to share our test as a short tutorial for the benefit of the community.

The original question reads as follows: ”Regarding sqrt(2), when written in decimal form 1 occurs 99925 times in the first 1 million digits. how many times does the digit 2 occur in the first 1 million hexadecimal digits?