Amazon SDE-I
Anonymous User
239
Aug 02, 2025
Amazon is known for asking data structures & algorithms (DSA) questions with a strong emphasis on problem-solving, clarity, and structured thinking
Question
You are given a list of tasks where each task has:
a unique taskId (integer),
a priority (integer),
and a cooldown period (integer) which specifies how many seconds must pass before the same task can be executed again.
You also have an infinite stream of time, and at each second, you can schedule at most one task.
Your goal is to schedule as many high-priority tasks as possible (maximize total priority executed) while respecting cooldowns.
Comments (2)


