PracHub
QuestionsLearningGuidesInterview Prep
|Home/Coding & Algorithms/Oscar

Find Clients Outside Provider Coverage

Last updated: Jul 28, 2026

Quick Overview

Identify every client missing at least one required specialty from providers within a permitted two-dimensional distance, preserving client order. Account for multiple providers, shared locations, exact distance boundaries, large query volumes, geographic coordinates, and optional missing-specialty output.

  • easy
  • Oscar
  • Coding & Algorithms
  • Software Engineer

Find Clients Outside Provider Coverage

Company: Oscar

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

## Problem Implement `outside_coverage(providers, clients, max_distance)`. Each provider has an `id`, a list of `specialties`, and a two-dimensional `location = [x, y]`. Each client has an `id`, a list of required specialties in `requirements`, and a two-dimensional location. A required specialty is covered when at least one provider offering that specialty is within Euclidean distance `max_distance` of the client. Different requirements may be covered by different providers. Return the IDs of clients for which at least one required specialty is not covered. Preserve client input order. ## Constraints - Up to `2,000` providers and `2,000` clients - Coordinates and `max_distance` are finite numbers; `max_distance >= 0` - Specialty strings within one record are unique. - Multiple providers or clients may share a location. - Distance exactly equal to `max_distance` is covered. ## Example Providers: ```text P1: specialties=[cardio, ortho], location=[0, 0] P2: specialties=[pedi], location=[5, 0] ``` Clients: ```text C1: requirements=[ortho], location=[1, 0] C2: requirements=[ortho, pedi], location=[1, 0] C3: requirements=[pedi], location=[4, 0] ``` With `max_distance = 2`, return `[C2]`. ## Hint Compare squared distances to avoid unnecessary square roots. Correctness requires checking every required specialty, not merely finding one nearby provider. ## Interview Follow-ups - Index providers to support many repeated queries. - Explain how the design changes in geographic coordinates rather than a flat plane. - Return the missing specialties for each uncovered client.

Quick Answer: Identify every client missing at least one required specialty from providers within a permitted two-dimensional distance, preserving client order. Account for multiple providers, shared locations, exact distance boundaries, large query volumes, geographic coordinates, and optional missing-specialty output.

Related Interview Questions

  • Solve Morse and Network Access Tasks - Oscar (medium)
|Home/Coding & Algorithms/Oscar

Find Clients Outside Provider Coverage

Oscar logo
Oscar
Jul 14, 2026, 12:00 AM
easySoftware EngineerTechnical ScreenCoding & Algorithms
0
0

Problem

Implement outside_coverage(providers, clients, max_distance).

Each provider has an id, a list of specialties, and a two-dimensional location = [x, y]. Each client has an id, a list of required specialties in requirements, and a two-dimensional location. A required specialty is covered when at least one provider offering that specialty is within Euclidean distance max_distance of the client. Different requirements may be covered by different providers.

Return the IDs of clients for which at least one required specialty is not covered. Preserve client input order.

Constraints

  • Up to 2,000 providers and 2,000 clients
  • Coordinates and max_distance are finite numbers; max_distance >= 0
  • Specialty strings within one record are unique.
  • Multiple providers or clients may share a location.
  • Distance exactly equal to max_distance is covered.

Example

Providers:

P1: specialties=[cardio, ortho], location=[0, 0]
P2: specialties=[pedi], location=[5, 0]

Clients:

C1: requirements=[ortho], location=[1, 0]
C2: requirements=[ortho, pedi], location=[1, 0]
C3: requirements=[pedi], location=[4, 0]

With max_distance = 2, return [C2].

Hint

Compare squared distances to avoid unnecessary square roots. Correctness requires checking every required specialty, not merely finding one nearby provider.

Interview Follow-ups

  • Index providers to support many repeated queries.
  • Explain how the design changes in geographic coordinates rather than a flat plane.
  • Return the missing specialties for each uncovered client.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Oscar•More Software Engineer•Oscar Software Engineer•Oscar Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding 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.