employer cover photo
employer logo
employer logo

Palantir Technologies

Is this your company?

Palantir Technologies Interview Question

Given an array of values, design and code an algorithm that returns whether there are two duplicates within k indices of each other? k indices and within plus or minus l (value) of each other? Do all, even the latter, in O(n) running time and O(k) space.

Interview Answer

Anonymous

Mar 2, 2013

The first is trivial. The second involves partitioning the real numbers into multiples of k.