← Fuse Energy Interview Insights

Fuse Energy·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Did a coding round for a Software Engineer role at Fuse Energy, building on a previous mini-spreadsheet problem. This one pushed further into graph territory and I had to think carefully about how dependency cycles actually propagate.

Questions Asked (1)

Q1

Given a spreadsheet that supports Set, Get, and SUM operations, extend it to detect circular dependencies. If assigning a SUM formula to a cell would create a cycle (direct or indirect) in the dependency graph, the operation should be rejected with an error.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

This was a follow-up to the basic spreadsheet problem so I thought I had a head start.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the spreadsheet as a directed graph where each cell is a node and dependencies (from SUM formulas) are edges. To detect cycles when setting a formula, perform a DFS from the target cell to see if it can reach itself through existing dependencies; if so, reject the operation. For efficiency, consider incremental cycle detection or topological sorting.

Pro tip: Mention that you can optimize by checking only the affected subgraph and using memoization or a visited set to avoid redundant traversals, and discuss trade-offs between eager and lazy cycle detection.

1. Clarify requirements and assumptions

Confirm the operations (Set, Get, SUM), the definition of a cycle (direct or indirect), and whether formulas can reference ranges or only individual cells. Also discuss error handling and performance expectations.

2. Model dependencies as a graph

Represent each cell as a node and each dependency (e.g., cell A depends on B and C) as directed edges from A to B and C. Explain that a cycle in this graph indicates a circular dependency.

3. Design cycle detection for Set operation

When setting a formula, before committing, traverse the dependency graph from the target cell to check if it can reach itself. Use DFS with a visited set to detect cycles efficiently.

4. Handle updates and maintain consistency

If no cycle, update the cell's formula and adjust the graph edges. If a cycle is detected, reject the operation and return an error without modifying the state.

5. Discuss optimizations and trade-offs

Consider incremental cycle detection, caching, or topological sorting for batch updates. Discuss time/space complexity and alternatives like union-find for undirected cycles (not applicable here).

Key Points to Mention

  • Directed graph representation of cell dependencies
  • DFS-based cycle detection with visited set
  • Incremental updates to the dependency graph
  • Time complexity: O(V+E) per Set operation, potential optimizations
  • Error handling and atomicity of operations
  • Trade-offs between eager vs lazy cycle detection

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