FastPrepMembers Lacking Provider Network Access
Problems/Members Lacking Provider Network Access

Members Lacking Provider Network Access

Oscar Health logoOscar Health● MediumFULLTIMEONSITE INTERVIEW
QuestionFunctionExamplesConstraints

Problem statement

You are given a list of providers and a list of members.

Each provider row is encoded as [providerId, specialty, x, y]. Each member row is encoded as [memberId, x, y, requiredSpecialties], where requiredSpecialties is a pipe-delimited string such as "Cardiology|Dermatology". All values are strings; the ids and coordinates are written as whole numbers.

A provider is within maxDistance of a member if the Euclidean (straight-line) distance between them is at most maxDistance. A distance of exactly maxDistance counts as within.

A member lacks adequate provider network access if there exists at least one required specialty for which no provider of that specialty lies within maxDistance of the member. Specialty names are case-sensitive.

Return the ids of all members who lack adequate access, as numbers in ascending order. Return an empty array if every member has adequate access.

Function

findMembersLackingAccess(providers: String[][], members: String[][], maxDistance: int) → int[]

Complete the function findMembersLackingAccess in the editor below.

findMembersLackingAccess has the following parameters:

  1. String[][] providers: provider rows [providerId, specialty, x, y]
  2. String[][] members: member rows [memberId, x, y, requiredSpecialties]
  3. int maxDistance: the maximum allowed Euclidean distance

The function returns an int[]: the ids of members lacking adequate access, sorted ascending.

Examples

Example 1

providers = [["1", "Cardiology", "1", "2"], ["2", "Dermatology", "3", "4"]]members = [["101", "2", "3", "Cardiology|Dermatology"], ["102", "10", "10", "Cardiology"]]maxDistance = 5return = [102]

Member 101 has both required specialties within distance 5. Member 102 has no nearby cardiology provider.

Example 2

providers = [["1", "Cardiology", "0", "0"]]members = [["1", "3", "4", "Cardiology"], ["2", "0", "0", "Dermatology"]]maxDistance = 5return = [2]

Member 1 is exactly distance 5 from the cardiology provider, so access is adequate. Member 2 requires dermatology, which is unavailable.

Constraints

  • 1 ≤ providers.length ≤ 2000
  • 1 ≤ members.length ≤ 2000
  • Every row of providers and members has exactly 4 strings.
  • Provider ids are distinct strings of 1 to 9 digits with no leading zero.
  • Member ids are distinct whole numbers with 1 ≤ memberId ≤ 109, written without leading zeros.
  • Every coordinate is a whole number with -104 ≤ x, y ≤ 104, written in plain decimal.
  • 0 ≤ maxDistance ≤ 3 * 104
  • A specialty name has 1 to 20 English letters.
  • Each requiredSpecialties lists 1 to 5 different specialty names separated by |.

More Oscar Health problems

  • Longest Name Chain in a Directed Acyclic GraphPHONE SCREEN · Seen Sep 2026
See Oscar Health hiring insights
Saved
class Solution {
    public int[] findMembersLackingAccess(String[][] providers, String[][] members, int maxDistance) {
        // write your code here
    }

}
Checking account…