Implement sampling and subarray algorithms
Company: Google
Role: Data Scientist
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Overview: Solve uniform 2D square sampling and longest increasing contiguous subarray. The solution maps Uniform(0,1) to Uniform(-1,1), proves uniformity by independence, and gives O(n) one-pass subarray algorithms with index recovery and edge cases.
Read the full Google Data Scientist interview experience this question came from