Microsoft Interview Question

Write a function that calculates square root of a given number.