The setup sounds like a BFS with some extra steps but the concurrent forwarding rule is where things get messy.
Model the satellite network as an undirected graph and simulate message propagation using a priority queue (min-heap) ordered by arrival time and satellite ID. Process operations in order, scheduling broadcasts and firing callbacks when messages arrive, ensuring chronological and lexicographic ordering.
Pro tip: Clarify edge cases upfront: simultaneous arrivals, duplicate links, and broadcasts to already-informed satellites. Use a tie-breaking rule (e.g., satellite ID) in the priority queue to guarantee deterministic ordering.
Ask about graph size, operation frequency, callback semantics, and tie-breaking rules. Confirm whether messages propagate only to directly linked satellites or through multiple hops.
Use an adjacency list for the graph, a map for satellite metadata, and a min-heap for pending message arrivals. Store callbacks in a list to fire in order.
For register, add satellite to map. For link, update adjacency list. For broadcast, schedule message to all neighbors with current time + latency, pushing events into the heap.
Process events from the heap in order, updating current time. When a satellite receives a message, fire its callback and propagate to neighbors if not already informed.
Write unit tests for edge cases: simultaneous arrivals, cycles, disconnected graphs, and multiple broadcasts. Verify callback order matches chronological and lexicographic rules.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.