Quick Overview

Implement a square-root routine based on Newton's method that returns the integer square root of a non-negative 32-bit integer, the largest value whose square does not exceed the input, without calling library square-root or power functions. It tests numerical iteration, termination conditions and exact integer arithmetic.

Integer Square Root with Newton's Method and No Library Calls

Company: Goldman Sachs

Role: Quantitative Researcher

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Overview: Implement a square-root routine based on Newton's method that returns the integer square root of a non-negative 32-bit integer, the largest value whose square does not exceed the input, without calling library square-root or power functions. It tests numerical iteration, termination conditions and exact integer arithmetic.

Read the full Goldman Sachs Quantitative Researcher interview experience this question came from

Integer Square Root with Newton's Method and No Library Calls

Goldman Sachs • Quantitative Researcher

Loading…