PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Veeva Systems

Compute build order from dependencies

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's understanding of graph algorithms and dependency resolution, including topological ordering, cycle detection, and implementing deterministic tie-breaking for valid execution orders.

  • Medium
  • Veeva Systems
  • Coding & Algorithms
  • Software Engineer

Compute build order from dependencies

Company: Veeva Systems

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

You are given a directed graph represented as a mapping where each key X maps to a list of tasks that depend on X (i.e., X must be completed before each listed task). Example: A: [B, C], B: [D, E], C: [D]. Implement solve(A) that outputs a valid execution order of all tasks reachable from A so that each task appears after all of its prerequisites. If multiple valid orders exist, break ties alphabetically. Detect and report cycles, and state the time and space complexity of your approach.

Quick Answer: This question evaluates a candidate's understanding of graph algorithms and dependency resolution, including topological ordering, cycle detection, and implementing deterministic tie-breaking for valid execution orders.

Veeva Systems logo
Veeva Systems
Jul 16, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
2
0

You are given a directed graph represented as a mapping where each key X maps to a list of tasks that depend on X (i.e., X must be completed before each listed task). Example: A: [B, C], B: [D, E], C: [D]. Implement solve(A) that outputs a valid execution order of all tasks reachable from A so that each task appears after all of its prerequisites. If multiple valid orders exist, break ties alphabetically. Detect and report cycles, and state the time and space complexity of your approach.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Veeva Systems•More Software Engineer•Veeva Systems Software Engineer•Veeva Systems Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.