← moveworks Interview Insights

moveworks·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Interviewed for a software engineering role at Moveworks and got a string similarity problem that looked deceptively simple at first glance. The math is straightforward once you break it down, but the edge cases are where things get interesting.

Questions Asked (1)

Q1

Given two strings, compute their Jaccard similarity using token sets: lowercase the input, split on non-alphabetic characters, discard empty tokens, deduplicate, then return the size of the intersection divided by the size of the union. Both sets empty should return 1.0.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The tokenization part is what trips you up if you're not careful.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the tokenization rules and edge cases, then walk through the algorithm step by step: normalize, tokenize, deduplicate, compute intersection and union, and handle the empty-set case. Emphasize efficiency and correctness, and discuss trade-offs such as using sets versus lists.

Pro tip: Explicitly call out the empty-set edge case (return 1.0) and mention that you'd write unit tests for it—this shows attention to detail and production readiness.

1. Clarify requirements and edge cases

Confirm the tokenization rules (lowercase, split on non-alphabetic, discard empty tokens) and the special case where both sets are empty (return 1.0). Ask if there are any constraints on input size or character encoding.

2. Outline the algorithm

Describe the steps: normalize the strings, tokenize into words, deduplicate tokens into sets, compute the intersection and union sizes, and return the ratio. Handle the empty-set case explicitly.

3. Analyze complexity and trade-offs

Discuss time and space complexity (O(n + m) time, O(n + m) space) and trade-offs between using sets versus lists for deduplication. Mention potential optimizations for large inputs.

4. Implement and test

Write clean code with meaningful variable names, and suggest unit tests covering normal cases, empty strings, and strings with only non-alphabetic characters.

Key Points to Mention

  • Tokenization: lowercase, split on non-alphabetic characters (e.g., regex [^a-z]+), discard empty tokens
  • Deduplication: use sets to store unique tokens
  • Jaccard similarity formula: |A ∩ B| / |A ∪ B|
  • Edge case: both sets empty → return 1.0
  • Time and space complexity: O(n + m) time, O(n + m) space
  • Testing: include cases with punctuation, mixed case, and empty inputs

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