← Snowflake Interview Insights

Snowflake·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
Jun 2026

Summary

Snowflake system design round for a software engineer role. The whole thing was one long question about building a dependency-aware service scheduler, and they kept pushing deeper into every corner of it.

Questions Asked (1)

Q1

Design a scheduler that starts services on a host with a fixed number of CPU cores, where services have dependencies forming a directed acyclic graph. The goal is to minimize total startup time while respecting those dependencies. Walk through how you detect which services are ready to run, how you maximize parallelism without exceeding core limits, how you handle prioritization, timeouts, retries, failures, and backoff. Also cover resource constraints beyond CPU (memory, ports), observability, the data structures you'd use, correctness guarantees, and how you'd extend this across multiple machines.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

This is the kind of question that looks manageable for the first five minutes and then just keeps expanding.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by modeling services as a DAG and using topological sort with in-degree tracking to identify ready services. Then design a scheduler that uses a priority queue to select among ready services, respecting CPU, memory, and port constraints, and handles failures with retries and backoff. Finally, discuss observability, correctness, and scaling to multiple machines.

Pro tip: Emphasize that the scheduler should be event-driven and idempotent, and that resource constraints beyond CPU (like memory and ports) often dominate in real systems, so design for extensibility from the start.

1. Model the problem and identify ready services

Represent services as a DAG and use in-degree counts to detect when a service's dependencies are satisfied. Maintain a ready queue of services with zero in-degree.

2. Design the scheduling loop with resource constraints

Use a priority queue to select ready services, and track available CPU cores, memory, and ports. Only start a service if all required resources are available; otherwise, defer it.

3. Handle failures, timeouts, retries, and backoff

Implement timeouts for service startup, retry with exponential backoff on failure, and propagate failures to dependents. Ensure the scheduler can recover from partial failures.

4. Add observability and correctness guarantees

Emit metrics (e.g., startup time, queue depth, resource utilization) and logs. Ensure correctness by preventing deadlocks, avoiding resource overcommitment, and guaranteeing all services eventually start if possible.

5. Extend to multiple machines

Discuss distributing the scheduler across machines, using a central coordinator or a distributed consensus protocol, and handling network partitions and cross-machine dependencies.

Key Points to Mention

  • Topological sort with in-degree tracking and a ready queue for dependency resolution.
  • Priority queue for selecting among ready services based on priority (e.g., critical path, service importance).
  • Resource constraints beyond CPU: memory, ports, disk I/O, and how to track and allocate them.
  • Retry policies with exponential backoff and jitter, and how to handle permanent failures.
  • Observability: metrics, logging, tracing, and alerting for scheduler health and service startup.
  • Scaling to multiple machines: distributed scheduling, consensus, and handling cross-machine dependencies.

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