← Adobe Interview Insights

Adobe·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Adobe frontend engineer interview with a graph-based coding problem. Pretty classic cycle detection framing but dressed up as a package manager scenario, which I actually thought was a nice touch compared to the usual 'detect cycle in a directed graph' prompt.

Questions Asked (1)

Q1

You're building a package manager where package A depends on package B, meaning B must be installed first. Write a function that determines whether all packages can be installed (i.e., no circular dependencies exist).

Algorithms & Data StructuresSystem Design
Author's notes

Took me a second to realize this was just cycle detection in a directed graph with extra packaging.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the packages and dependencies as a directed graph, then detect cycles using either Kahn's algorithm (topological sort) or DFS with recursion stack. Clearly explain the graph representation, the cycle detection method, and analyze time and space complexity.

Pro tip: Mention that Kahn's algorithm is often preferred in production systems because it naturally handles large graphs and can detect cycles while producing an installation order. Also note that real package managers must handle version constraints and conflicts, so this is a simplified model.

1. Clarify the problem and assumptions

Confirm that dependencies are directed edges (A -> B means A depends on B), and that we need to check if a valid installation order exists. Ask about input format (adjacency list, edge list) and constraints.

2. Choose a graph representation

Represent packages as nodes and dependencies as directed edges. Use an adjacency list for efficiency, and optionally compute in-degrees for Kahn's algorithm.

3. Select a cycle detection algorithm

Explain either Kahn's algorithm (repeatedly remove nodes with in-degree 0) or DFS with a recursion stack (detect back edges). Describe how each detects cycles.

4. Walk through an example

Trace the algorithm on a small graph, e.g., A->B, B->C, C->A (cycle) and A->B, B->C (no cycle), to demonstrate correctness.

5. Analyze complexity and edge cases

State time and space complexity (O(V+E) for both algorithms). Discuss edge cases: empty graph, self-loop, disconnected components, and large graphs.

Key Points to Mention

  • Directed graph representation: nodes as packages, edges as dependencies.
  • Cycle detection via topological sort (Kahn's algorithm) or DFS with recursion stack.
  • Time and space complexity: O(V+E) time, O(V+E) space.
  • Handling disconnected components and self-loops.
  • Real-world considerations: version constraints, conflict resolution, and scalability.
  • Alternative approach: union-find for undirected cycles (not applicable here, but shows awareness).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.