Task Master (Also for Infra Automation Intern)

Problem Overview

  • Find the maximum number of tasks Eric can finish while respecting notes: you cannot do a task if it must precede any already completed task.
  • Input: n tasks and arrays a, b where each pair a[i] -> b[i] means a before b; Output: integer count of doable tasks.
  • Constraints: 1 ≤ n ≤ 1e5; each task depends on at most one other task.
  • Domain: task scheduling and dependency management for project/infra automation.
  • From Snowflake interviews; a coding interview problem and common interview question for Infra Automation Intern roles.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: