Snowflake·Software Engineer·Technical Phone Screen
- Given n courses and a list of prerequisite pairs, determine whether it's possible to complete all courses (i.e., detect if the prerequisite graph contains a cycle).
- Follow-up on the course scheduling problem: if it is possible to finish all courses, what is the minimum number of semesters needed, given that you can take any number of courses per semester as long as prerequisites are satisfied?
- You're given a non-decreasing array of request timestamps. A rate limiter drops a request if it exceeds 3 requests at the same timestamp, or if processing it would push the count of processed requests in any 10-second sliding window above 20. Return the timestamps of all dropped requests in order.
“Classic cycle detection in a directed graph.”