← Harvey AI Interview Insights

Harvey AI·Machine Learning Engineer·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Technical round at Harvey AI for an ML engineer role, centered on a pretty involved NLP-adjacent problem. No ML libraries allowed which made it more interesting than I expected.

Questions Asked (1)

Q1

Given an input string, design a tree or graph-based algorithm to transform it into a target tokenized sequence. You must simulate embeddings without using any ML models, and validate the final output.

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

This one took me a minute to even parse what they were asking.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: define the input string, target tokenized sequence, and the goal of simulating embeddings without ML models. Then propose a graph-based approach where nodes represent tokens or characters, edges represent transformations (e.g., merges, splits), and use a deterministic embedding simulation (e.g., one-hot or hash-based) to guide the transformation. Finally, outline validation steps to ensure the output matches the target sequence.

Pro tip: Emphasize that the algorithm should be deterministic and interpretable, as Harvey AI values transparency in AI systems; also mention that you would consider edge cases like unknown tokens and scalability to large inputs.

1. Clarify Requirements and Constraints

Ask questions to understand the input format, target tokenization rules, and any constraints (e.g., no ML models, allowed operations). Confirm that 'simulate embeddings' means creating fixed vector representations without learning.

2. Design the Graph Representation

Propose a directed graph where nodes are tokens (or characters) and edges represent possible transformations (e.g., concatenation, splitting, substitution). Define how to assign simulated embeddings to nodes (e.g., one-hot, random but fixed, or hash-based).

3. Define the Transformation Algorithm

Outline a search algorithm (e.g., BFS/DFS or dynamic programming) that traverses the graph to find a sequence of operations transforming the input string into the target token sequence, using the simulated embeddings to guide decisions (e.g., similarity scores).

4. Validate the Output

Describe validation: compare the resulting token sequence to the target, check for exact match or acceptable edit distance, and ensure all operations are valid. Discuss how to handle failures (e.g., backtracking).

5. Analyze Complexity and Trade-offs

Discuss time and space complexity, and trade-offs between different graph structures (e.g., token-level vs. character-level) and search strategies. Mention scalability and potential optimizations.

Key Points to Mention

  • Graph construction: nodes as tokens/characters, edges as transformations (merge, split, substitute).
  • Simulated embeddings: deterministic methods like one-hot encoding, hash-based vectors, or pre-defined static embeddings.
  • Search algorithm: BFS/DFS, A*, or dynamic programming to find optimal transformation path.
  • Validation: exact match, edit distance, or sequence alignment; handling of unknown tokens.
  • Complexity analysis: time/space complexity of graph traversal and embedding simulation.
  • Trade-offs: token-level vs. character-level graphs, greedy vs. optimal search, and scalability.

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