HomeInterview QuestionsHow do you assign sequence to multiple transformat…

How do you assign sequence to multiple transformation code files using a DAG so that the system knows which file to execute first?

🟡 Medium Conceptual Junior level
1Times asked
Jul 2026Last seen
Jul 2026First seen

💡 Model Answer

A Directed Acyclic Graph (DAG) represents dependencies between transformation steps. Each node is a transformation file, and an edge from A to B indicates that B depends on A. To assign execution order, you perform a topological sort of the DAG, which yields a linear ordering that respects all dependencies. In practice, you annotate each file with metadata (e.g., a list of upstream files) or use an orchestrator like Airflow, where you define tasks and set their upstream/downstream relationships. The orchestrator then schedules tasks based on the DAG, ensuring that a file runs only after all its dependencies have completed. This guarantees deterministic execution order and avoids race conditions.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.

Get Assisting AI — Starts at ₹500