Snowflake·Software Engineer·Technical Phone Screen
- You have a chronologically ordered log array where each line starts with '[Info]', '[Warn]', or '[Error]'. Once an '[Error]' appears, all subsequent lines are also errors, and there's at least one '[Warn]' right before the first error. Find the index of the first '[Error]' using as few reads as possible. What do you return if no error exists?
- Given a directed service dependency graph where an edge U to V means U calls V, and given the ID of the first failing service, find all services that will eventually fail due to cascading upstream failures.
- Using the same graph and initial failing service, find one of the longest possible chains of cascading failures starting from that service. State your assumptions about cycles and justify them.
“Binary search, obviously, but I fumbled explaining why the guarantees matter.”