← Snowflake Interview Insights

Snowflake·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Snowflake software engineer interview, round 2 was a coding round. Got the parallel scheduling problem and then a harder follow-up variant. Finished the base version in about 20 minutes which felt decent.

Questions Asked (1)

Q1

Given a set of tasks with dependencies, design a solution to schedule them in parallel (and then solve a harder variant of the same problem).

Algorithms & Data StructuresSystem Design
Author's notes

Knocked out the base version in around 20 minutes, felt pretty clean.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by modeling the tasks and dependencies as a directed acyclic graph (DAG), then use topological sorting to determine a valid execution order. For parallel scheduling, compute the earliest start time for each task using longest path in the DAG, and discuss resource constraints. For the harder variant, consider limited resources (e.g., number of workers) and propose a greedy or priority-based scheduling algorithm, analyzing its complexity and optimality.

Pro tip: Explicitly state assumptions about the number of workers and whether tasks can be preempted; this shows you understand real-world scheduling constraints. Also, mention that the problem is NP-hard when resources are limited, so you'll discuss heuristics and trade-offs.

1. Clarify requirements and assumptions

Ask about the number of workers, task durations, whether tasks can be preempted, and the goal (minimize makespan vs. maximize throughput). This ensures you solve the right problem.

2. Model as a DAG and compute dependencies

Represent tasks as nodes and dependencies as directed edges. Perform topological sort to detect cycles and get a valid order.

3. Schedule with unlimited parallelism

Compute earliest start and finish times for each task using longest path from source. The makespan is the maximum finish time. This gives an optimal schedule when resources are unlimited.

4. Handle limited resources (harder variant)

When the number of workers is limited, the problem becomes NP-hard. Propose a greedy list scheduling algorithm: at each step, assign ready tasks to available workers using a priority (e.g., critical path). Discuss approximation bounds.

5. Analyze complexity and trade-offs

For unlimited resources, O(V+E) for topological sort and longest path. For limited resources, list scheduling is O(V log V) with a priority queue, but may not be optimal. Mention alternative approaches like integer programming for small instances.

Key Points to Mention

  • Directed Acyclic Graph (DAG) representation and cycle detection
  • Topological sorting and longest path algorithm for earliest start times
  • Critical path method (CPM) and its role in determining makespan
  • List scheduling with priority queues for limited resources
  • NP-hardness of parallel scheduling with resource constraints
  • Approximation algorithms and performance bounds (e.g., Graham's bound)

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