FastPrepDependency-Aware Task Scheduler
Problems/Dependency-Aware Task Scheduler

Dependency-Aware Task Scheduler

Rippling logoRippling● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Rippling phone screen. The report describes outputting tasks in an order that respects dependencies, an importance or priority for each task, and filtering. We chose a fixed edge list, a Boolean filter, a fixed tie rule for ready tasks, and what to return on a cycle. Our version is about 72% the same as the reported question.

You are given a list of task ids, a list of dependencies, a priority for each task, and a flag for each task that says whether it is included. A dependency [before, after] means before must come before after.

Only tasks whose included value is true take part. Ignore any dependency that has a filtered-out task at either end. Then build the schedule one task at a time. At each step, look at the tasks whose prerequisites are all done. Pick the one with the highest priority. If two tasks have the same priority, pick the lexicographically smaller task identifier.

Return the schedule. If the included tasks have a dependency cycle, return an empty array.

Function

scheduleTasks(taskIds: String[], dependencies: String[][], priorities: int[], included: boolean[]) → String[]

Examples

Example 1

taskIds = ["extract","clean","load","audit"]dependencies = [["extract","clean"],["clean","load"]]priorities = [2,5,4,9]included = [true,true,true,true]return = ["audit","extract","clean","load"]

Task audit has no prerequisites and the highest priority, so it goes first. Then extract is the only task that is ready, followed by clean and then load, because each one waits for the one before it.

Example 2

taskIds = ["a","b","c"]dependencies = [["a","b"],["b","c"]]priorities = [1,10,5]included = [false,true,true]return = ["b","c"]

Task a is filtered out, so the edge [a, b] is dropped with it. Now b has no prerequisites, so it goes first, and c follows. The answer is ["b","c"].

Example 3

taskIds = ["a","b"]dependencies = [["a","b"],["b","a"]]priorities = [1,2]included = [true,true]return = []

Each task waits for the other, so neither can ever go first. The tasks form a cycle, and the answer is an empty array.

Constraints

  • 1 <= taskIds.length == priorities.length == included.length <= 20000.
  • Task identifiers are unique nonempty ASCII strings.
  • -10^9 <= priorities[i] <= 10^9.
  • 0 <= dependencies.length <= 50000; every edge contains two known, different identifiers and edges are distinct.

More Rippling Phone Screen questions

  • Filter, Sort, and Deduplicate Scheduled TasksPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Stateful Log Transform and SearchPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Delivery Cost Tracker with Effective-Dated RatesPHONE SCREEN · Seen Nov 2026
  • Camel CardsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best and Worst Camel Card CompletionsPHONE SCREEN · Seen Nov 2026
  • Corporate Card Expense RulesOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • In-Memory Priority Task SchedulerPHONE SCREEN · Seen Oct 2026
  • Limit an Organization Tree's HeightPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Median Across N Sorted ArraysPHONE SCREEN · Seen Oct 2026
  • Delivery Cost TrackerPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Course Schedule IIAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Task Scheduler with Prerequisites and Execution PathsBrex · PHONE SCREEN
  • Lexicographically Smallest Topological OrderByteDance · PHONE SCREEN · ONSITE INTERVIEWByteDance interview questions
  • Merge Subsequences Into a Consistent Total OrderGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Lexicographic Dependency OrderIllumio · PHONE SCREENIllumio interview questions
  • Topological Sort with Secondary OrderingRoblox · PHONE SCREEN · ONSITE INTERVIEWRoblox interview questions
  • Order Sources by Their DependenciesRetool · PHONE SCREENRetool interview questions
  • Dependency-Aware Agent Task SchedulerOpenAI · PHONE SCREENOpenAI interview questions
  • Lexicographically Smallest Dependency OrderOkta · PHONE SCREENOkta interview questions
  • Course Completion OrderIndeed · PHONE SCREENIndeed interview questions

Interview reports that mention this question

  • Rippling No-Level Design, Screens: 30 Experiences (Part 2 of 6)
  • Rippling SWE Interviews, No Level: 156 Experiences (Part 1 of 6)
  • Rippling Experienced SWE AI-Assisted Phone Screen: 1 Experience

Rippling interview experiences

  • Rippling Senior SWE Full Loop Questions: 1 Experience
  • Rippling Experienced SWE Phone Screens: 2 Experiences
  • Rippling Design Rounds and Onsites: 17 Experiences (Part 3 of 3)
All Rippling interview questionsSee Rippling hiring insights
Saved
class Solution {
    public String[] scheduleTasks(String[] taskIds, String[][] dependencies, int[] priorities, boolean[] included) {
        // Write your code here.
    }
}
Checking account…