amazon logo
Amazon· SDE II

Amazon | AWS | SDE2 role

Posted
11 May 2026
536 reads

Summary

I had a phone screen round with Amazon AWS where I was asked one coding question related to task scheduling with dependencies and cooldown constraints.

How it went

Hi,
This was the question asked to me today in AWS phone screen round :

You are given n tasks. Each task has:

  • A type (string/character)
  • A list of dependencies (other tasks that must finish first)

Rules:

  1. Each task takes 1 unit of time to execute.
  2. Tasks of the same type must be separated by a cooldown of k units (i.e., after executing a task of type X at time t, the next task of type X can only run at time ≥ t + k + 1).
  3. A task is ready only after all its dependencies have completed.
  4. If no task is ready or all ready tasks are blocked by cooldown, time advances (idle).

Find the minimum time to complete all the tasks.

example :
{t1 -> "A",
t2->"A",
t3->"B",
t4->"A",
t5->"B"}
dependencies : {[t3,t1], [t4, t2]}
cooldown : 2

result : 7

Questions asked (1)

  1. 01

    Task Scheduling with Dependencies and Cooldown

    Data Structures & Algorithms · Hard

    You are given n tasks. Each task has:

    • A type (string/character)
    • A list of dependencies (other tasks that must finish first)

    Rules:

    1. Each task takes 1 unit of time to execute.
    2. Tasks of the same type must be separated by a cooldown of k units (i.e., after executing a task of type X at time t, the next task of type X can only run at time ≥ t + k + 1).
    3. A task is ready only after all its dependencies have completed.
    4. If no task is ready or all ready tasks are blocked by cooldown, time advances (idle).

    Find the minimum time to complete all the tasks.

    Example:
    Tasks: {t1 → "A", t2→"A", t3→"B", t4→"A", t5→"B"}
    Dependencies: {[t3,t1], [t4, t2]}
    Cooldown: 2
    Result: 7

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Amazon recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!