← Openai Interview Insights

Openai·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Interviewed for a SWE role at OpenAI and got a problem themed around infectious disease spread on a network, but the details were vague enough that I'm still not totally sure what they were actually asking for.

Questions Asked (1)

Q1

Given a network of cities and contacts, along with some initially infected nodes, simulate or compute metrics related to how an infectious disease spreads through the network.

Algorithms & Data StructuresAdaptability & AmbiguitySystem Design
Author's notes

The problem was loosely framed around disease spread on a graph, which sounds interesting, but the actual inputs, outputs, and rules were never clearly defined.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem scope first: whether to simulate step-by-step spread or compute aggregate metrics like total infected or peak infection time. Then choose an appropriate model (e.g., SIR, SI) and algorithm (BFS for discrete steps, or differential equations for continuous), and discuss trade-offs between simulation and analytical approaches.

Pro tip: Demonstrate adaptability by acknowledging that real-world disease spread involves uncertainty; propose a probabilistic model and discuss how to validate it with historical data or sensitivity analysis.

1. Clarify Requirements and Assumptions

Ask questions to understand the desired output: simulation over time, final metrics, or both? Clarify network properties (directed/undirected, weighted), infection model (SI, SIR, SEIR), and time granularity.

2. Choose Model and Algorithm

Select a compartmental model (e.g., SIR) and an algorithm: BFS for discrete-time simulation, or numerical integration for continuous-time. Consider scalability for large networks.

3. Design Data Structures and Simulation Loop

Represent the network as an adjacency list. Maintain state for each node (susceptible, infected, recovered). Iterate over time steps, updating states based on infection probabilities and recovery rates.

4. Compute and Validate Metrics

Track metrics like total infected, peak infection, and basic reproduction number (R0). Validate the model with small test cases or known results.

5. Discuss Extensions and Trade-offs

Address scalability (e.g., using sampling for large graphs), uncertainty (stochastic vs deterministic), and potential optimizations (parallelization, approximate methods).

Key Points to Mention

  • Choice of epidemiological model (SI, SIR, SEIR) and its implications
  • Graph representation and traversal algorithms (BFS, DFS) for spread simulation
  • Time complexity and scalability for large networks (e.g., O(V+E) per step)
  • Metrics: total infected, peak infection time, R0, and their computation
  • Stochastic vs deterministic simulation and handling uncertainty
  • Validation and sensitivity analysis to ensure model robustness

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.