PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Oscar

Solve Morse and Network Access Tasks

Last updated: May 2, 2026

Quick Overview

This question evaluates string encoding/decoding and combinatorial parsing skills (Morse code conversion and ambiguous decoding) alongside spatial search and filtering competencies for proximity-based access checks, testing algorithmic reasoning, pattern recognition, backtracking possibilities, distance computation, and data-structure use.

  • medium
  • Oscar
  • Coding & Algorithms
  • Software Engineer

Solve Morse and Network Access Tasks

Company: Oscar

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Solve the following two independent coding problems. ### Problem 1: Convert Between Text and Morse Code You are given the standard Morse-code mapping for lowercase English letters: - a: .- - b: -... - c: -.-. - d: -.. - e: . - f: ..-. - g: --. - h: .... - i: .. - j: .--- - k: -.- - l: .-.. - m: -- - n: -. - o: --- - p: .--. - q: --.- - r: .-. - s: ... - t: - - u: ..- - v: ...- - w: .-- - x: -..- - y: -.-- - z: --.. Given a string consisting only of lowercase English letters, return the concatenated Morse-code representation of the string. Example: Input: `"gin"` Output: `"--...-."` Follow-up: Given a Morse-code string with no separators between letters, generate all possible original lowercase strings that could have produced it. ### Problem 2: Find Members Without Adequate Provider Access You are given: - A list of providers, where each provider has an `id`, `specialty`, and 2D `location`. - A list of members, where each member has an `id`, 2D `location`, and a list of `required_specialties`. - A `max_distance` value. A member has adequate network access if, for every specialty they require, there is at least one provider of that specialty within `max_distance` of the member. Use Euclidean distance between locations. Return the list of member IDs who do not have adequate network access. Example: ```text providers = [ {"id": 1, "specialty": "Cardiology", "location": (1, 2)}, {"id": 2, "specialty": "Dermatology", "location": (3, 4)} ] members = [ {"id": 101, "location": (2, 3), "required_specialties": ["Cardiology", "Dermatology"]}, {"id": 102, "location": (10, 10), "required_specialties": ["Cardiology"]} ] max_distance = 5 ``` Output: ```text [102] ```

Quick Answer: This question evaluates string encoding/decoding and combinatorial parsing skills (Morse code conversion and ambiguous decoding) alongside spatial search and filtering competencies for proximity-based access checks, testing algorithmic reasoning, pattern recognition, backtracking possibilities, distance computation, and data-structure use.

Oscar logo
Oscar
Apr 15, 2026, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
1
0

Solve the following two independent coding problems.

Problem 1: Convert Between Text and Morse Code

You are given the standard Morse-code mapping for lowercase English letters:

  • a: .-
  • b: -...
  • c: -.-.
  • d: -..
  • e: .
  • f: ..-.
  • g: --.
  • h: ....
  • i: ..
  • j: .---
  • k: -.-
  • l: .-..
  • m: --
  • n: -.
  • o: ---
  • p: .--.
  • q: --.-
  • r: .-.
  • s: ...
  • t: -
  • u: ..-
  • v: ...-
  • w: .--
  • x: -..-
  • y: -.--
  • z: --..

Given a string consisting only of lowercase English letters, return the concatenated Morse-code representation of the string.

Example: Input: "gin" Output: "--...-."

Follow-up: Given a Morse-code string with no separators between letters, generate all possible original lowercase strings that could have produced it.

Problem 2: Find Members Without Adequate Provider Access

You are given:

  • A list of providers, where each provider has an id , specialty , and 2D location .
  • A list of members, where each member has an id , 2D location , and a list of required_specialties .
  • A max_distance value.

A member has adequate network access if, for every specialty they require, there is at least one provider of that specialty within max_distance of the member. Use Euclidean distance between locations.

Return the list of member IDs who do not have adequate network access.

Example:

providers = [
  {"id": 1, "specialty": "Cardiology", "location": (1, 2)},
  {"id": 2, "specialty": "Dermatology", "location": (3, 4)}
]

members = [
  {"id": 101, "location": (2, 3), "required_specialties": ["Cardiology", "Dermatology"]},
  {"id": 102, "location": (10, 10), "required_specialties": ["Cardiology"]}
]

max_distance = 5

Output:

[102]

Comments (0)

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 7,500+ 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.