PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Google

Implement sampling and subarray scan

Last updated: Mar 29, 2026

Quick Overview

This question evaluates probabilistic sampling and random-number transformation concepts for generating uniform points in a continuous domain, alongside array-processing and algorithmic analysis skills for identifying the longest strictly increasing contiguous subarray.

  • medium
  • Google
  • Coding & Algorithms
  • Data Scientist

Implement sampling and subarray scan

Company: Google

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

A coding interview included the following algorithm questions: 1. You are given access to a function `rand01()` that returns an independent sample from `Uniform(0, 1)`. Write a function that returns a 2D point `(x, y)` uniformly distributed over the square `(-1, 1) x (-1, 1)`. You may call `rand01()` as many times as needed. 2. Given an integer array `nums`, find the length of the longest strictly increasing contiguous subarray (also called the longest increasing continuous subarray). Clarify the time and space complexity of your approach, and mention how you would recover the actual subarray indices if needed.

Quick Answer: This question evaluates probabilistic sampling and random-number transformation concepts for generating uniform points in a continuous domain, alongside array-processing and algorithmic analysis skills for identifying the longest strictly increasing contiguous subarray.

Related Interview Questions

  • Solve Rooms and Top-K Streams - Google (medium)
  • Find Containing Range - Google (medium)
  • Rearrange Tasks With Cooldown - Google (medium)
  • Implement Employee Management and Expression Evaluation - Google (medium)
  • Solve Three Array and Matrix Path Problems - Google (medium)
Google logo
Google
Feb 5, 2025, 12:00 AM
Data Scientist
Technical Screen
Coding & Algorithms
3
0

A coding interview included the following algorithm questions:

  1. You are given access to a function rand01() that returns an independent sample from Uniform(0, 1) . Write a function that returns a 2D point (x, y) uniformly distributed over the square (-1, 1) x (-1, 1) . You may call rand01() as many times as needed.
  2. Given an integer array nums , find the length of the longest strictly increasing contiguous subarray (also called the longest increasing continuous subarray). Clarify the time and space complexity of your approach, and mention how you would recover the actual subarray indices if needed.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Google•More Data Scientist•Google Data Scientist•Google Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.