Bloomberg Interview Question

write a method/function to find the root of a function? Eventually simplified to write a binary search based function to find the square root of a number