← HarveyAI Interview Insights

HarveyAI·Software Engineer·Onsite - Coding / Algorithms·Intermediate

IntermediateRejected
May 2026

Summary

Coding round at HarveyAI for a Software Engineer role. The problem itself was interesting but the whole session was derailed by an interviewer who seemed completely checked out, and I ended up burning too much time just trying to get basic responses out of him.

Questions Asked (1)

Q1

Given a map of symbol expressions, compute the resolved value for each symbol using graph traversal.

Algorithms & Data Structures
Author's notes

Classic DFS setup but with a wrinkle.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the symbol expressions as a directed graph where each symbol points to its dependencies, then perform a topological sort or DFS with memoization to resolve values in dependency order. Detect cycles to handle invalid expressions and return an error or default value.

Pro tip: Clarify with the interviewer whether the graph is guaranteed acyclic and whether symbols can have multiple expressions; this shows you think about edge cases and real-world data quality.

1. Parse and Build Graph

Parse the map of symbol expressions into a graph representation, where each symbol is a node and edges represent dependencies on other symbols.

2. Detect Cycles

Use DFS with a recursion stack or topological sort to detect cycles; if a cycle exists, handle it by returning an error or a sentinel value.

3. Resolve Values

Perform a topological sort or DFS with memoization to compute each symbol's value in dependency order, caching results to avoid redundant work.

4. Handle Edge Cases

Consider symbols with no dependencies (base cases), missing symbols, and expressions that reference undefined symbols; decide on appropriate error handling.

5. Analyze Complexity

Discuss time and space complexity: O(V+E) for graph traversal, where V is number of symbols and E is number of dependencies.

Key Points to Mention

  • Graph representation: adjacency list or map from symbol to dependencies
  • Topological sorting or DFS with memoization for efficient resolution
  • Cycle detection using recursion stack or Kahn's algorithm
  • Handling of base cases (symbols with constant values) and missing symbols
  • Time and space complexity analysis: O(V+E) time, O(V) space
  • Error handling for invalid expressions or cycles

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