Design a satellite propagation simulator

Quick Overview

Design a satellite propagation simulator evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Design a satellite propagation simulator

Company: Optiver

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Take-home Project

Design an object-oriented SatelliteNetwork that processes a stream of instructions to simulate message propagation and determine report-back order and times. Implement these methods: 1) SatelliteConnected(SatelliteId): Add a satellite node to the network. 2) RelationshipEstablished(SatelliteId1, SatelliteId 2): Add an undirected connection between two satellites. 3) MessageReceived(M, SatelliteId_1, ..., SatelliteId_M): Treat the given M satellites as simultaneously notified at time t=0, then simulate propagation and return the list of (SatelliteId, reportTimeSeconds) ordered by the time they report back to Earth (ties broken by smaller SatelliteId). Simulation rules and constraints: - Forwarding latency: It takes exactly 10 seconds for a satellite to forward a message to one of its direct connections. Forwarding to neighbors is synchronous and atomic per sender: a sender can forward to only one neighbor at a time, each taking 10 seconds. - Forwarding order: Each satellite forwards to all direct connections it has not already notified, strictly in increasing SatelliteId order. - Single effective notify: Once a receiver is notified (by any source), it is considered notified; no further notification attempts change its state. However, concurrent attempts from other senders to notify the same receiver still each consume 10 seconds of the sender’s time. - No immediate back-edge: A satellite never notifies the satellite that most recently notified it. - Processing delay: After a satellite’s direct connections are all notified (from its perspective and per the ordered forwarding it performs), it waits 30 seconds, then it processes the message and reports back to Earth. - Reporting tie-breaker: If two satellites finish processing at the same time, the one with the smaller SatelliteId is considered to arrive first. - Multiple messages: Each call to MessageReceived represents a new message whose initial notified set is the provided satellites at t=0. Clarify whether propagation state resets per message (typical) or persists; implement accordingly and justify. Output and complexity: - MessageReceived should return a stable ordering of (SatelliteId, reportTimeSeconds) for all satellites that become notified in that propagation, ordered by increasing report time with SatelliteId tie-breakers. - Describe and justify your data structures (e.g., adjacency lists with sorted neighbors, event queue/simulator, per-node state with first-notify time, sender schedules), the event scheduling strategy (e.g., priority queue on next-available time and notify events), and the time/space complexities in terms of V (satellites), E (relationships), and degree distribution. Edge cases to cover: - Disconnected components; satellites never reached should not appear in the output. - Multiple concurrent attempts to notify the same target; ensure only the earliest arrival sets its notify time while all senders still incur 10 seconds. - Large hubs with many neighbors and the impact of strict SatelliteId ordering on timelines. - Re-entrant calls to MessageReceived with overlapping or disjoint initial sets.

Quick Answer: Design a satellite propagation simulator evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

|Home/System Design/Optiver
Optiver logo
Optiver
Jul 16, 2025, 12:00 AM
hardSoftware EngineerTake-home ProjectSystem Design
51
0

Design a satellite propagation simulator

Object-Oriented SatelliteNetwork: Message Propagation Simulator

Design and implement an object-oriented SatelliteNetwork that processes a stream of instructions to simulate message propagation and determine the report-back order and times for satellites.

Assumptions and scope:

  • The network topology (satellites and undirected relationships) persists across calls.
  • Propagation state resets per message: each call to MessageReceived starts a fresh propagation using the current topology (typical semantics for independent messages).
  • The graph is simple (no parallel edges); neighbor lists are maintained in strictly increasing SatelliteId order.

API

Implement the following methods:

  1. SatelliteConnected(SatelliteId)
    • Add the satellite node to the network if not already present.
  2. RelationshipEstablished(SatelliteId1, SatelliteId2)
    • Add an undirected connection between the two satellites.
    • Maintain neighbors in strictly increasing SatelliteId order (stable over time).
  3. MessageReceived(M, SatelliteId_1, ..., SatelliteId_M) → List[(SatelliteId, reportTimeSeconds)]
    • Treat the given M satellites as simultaneously notified at time t=0.
    • Simulate propagation according to the rules below.
    • Return a list of (SatelliteId, reportTimeSeconds) for all satellites that become notified in this propagation, ordered by report time ascending, using SatelliteId as a tie-breaker.

Simulation rules

  • Forwarding latency:
    • It takes exactly 10 seconds for a satellite to forward a message to one direct neighbor.
    • A sender can forward to only one neighbor at a time (sequential), each attempt consuming 10 seconds.
    • Forwarding to neighbors is synchronous and atomic per sender.
  • Forwarding order:
    • Each satellite forwards to all of its direct neighbors it has not already notified (from its own perspective), strictly in increasing SatelliteId order.
  • Single effective notify:
    • Once a receiver is notified (by any source), it is considered notified; further attempts do not change its state.
    • However, concurrent or later attempts to the same receiver still consume 10 seconds of the sender’s time.
  • No immediate back-edge:
    • A satellite never forwards to the specific neighbor that most recently notified it (its effective notifier). For initial satellites at t=0, there is no prior notifier, so nothing is excluded.
  • Processing and reporting delay:
    • After a satellite completes all of its own forwarding attempts (per the ordered list it performs, with the above back-edge exclusion), it waits 30 seconds, then reports back to Earth.
  • Tie-breaking:
    • Reporting: If two satellites finish processing at the same time, the smaller SatelliteId reports first.
    • Simultaneous notify arrivals: If multiple notify attempts arrive to the same satellite at the exact same time, the attempt from the smaller sender SatelliteId is deemed the effective notifier.

Output and complexity expectations

  • MessageReceived returns a stable ordering of (SatelliteId, reportTimeSeconds) for all satellites reached during that propagation.
  • Describe and justify your data structures (e.g., adjacency lists with sorted neighbors, event queue/simulator, per-node state with first-notify time and effective notifier) and the event scheduling strategy (e.g., priority queue of notify-attempt completions).
  • Provide time and space complexity in terms of V (satellites), E (relationships), and the degree distribution.

Edge cases to handle

  • Disconnected components: satellites never reached must not appear in the output.
  • Multiple concurrent attempts to notify the same target: only the earliest arrival sets its notify time; all senders still incur 10 seconds per attempt.
  • Large hubs with many neighbors: honoring strict SatelliteId order significantly impacts timelines.
  • Re-entrant calls to MessageReceived with overlapping or disjoint initial sets: topology persists; propagation state resets.

Clarifying Questions to Ask Guidance

  • Clarify users, core use cases, read/write patterns, scale, latency, availability, and data retention.
  • State explicit assumptions before making sizing or architecture decisions.
  • Prioritize the functional path first, then address reliability, security, observability, and rollout.

What a Strong Answer Covers Guidance

  • A scoped requirements summary with concrete non-goals and success metrics.
  • API, data model, architecture, consistency, capacity, and operations.
  • Reasoned trade-offs among simple and scalable designs, including bottlenecks and failure modes.
  • A validation, monitoring, migration, and launch plan appropriate for the risk level.

Follow-up Questions Guidance

  • What breaks first at 10x traffic or data volume?
  • How would you degrade gracefully during dependency failures?
  • What metrics and alerts would prove the design is healthy after launch?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...