← Verkada Interview Insights

Verkada·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Verkada software engineering interview, coding round. One question, all about implementing Wordle-style scoring with correct duplicate letter handling. Trickier than it looks.

Questions Asked (1)

Q1

Implement a function that scores a guess against a secret word, returning an array where each position is 2 (exact match), 1 (letter exists elsewhere but not matched yet), or 0 (letter not in word or already consumed). Handle duplicate letters correctly and validate inputs.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The basic green/yellow/gray logic clicks fast, the part that bites you is duplicates.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and edge cases, then describe a two-pass algorithm: first mark exact matches (2) and count remaining letters, then mark partial matches (1) while consuming letters from the count. Finally, discuss input validation and complexity.

Pro tip: Emphasize that the order of marking matters: exact matches must be processed first to correctly handle duplicates, and using a frequency map for the secret word ensures O(n) time. Also, mention that you would validate inputs for length and character set to avoid undefined behavior.

1. Clarify requirements and edge cases

Ask about input constraints: are words the same length? What characters are allowed? How to handle invalid inputs? Confirm the scoring rules, especially for duplicates.

2. Outline the two-pass algorithm

First pass: iterate through both words, mark exact matches as 2, and build a frequency map of unmatched letters in the secret word. Second pass: for each non-exact position, if the guess letter exists in the frequency map with count > 0, mark as 1 and decrement the count; otherwise mark as 0.

3. Discuss input validation

Validate that both inputs are strings of equal length and contain only allowed characters (e.g., lowercase letters). If invalid, throw an error or return a meaningful message.

4. Analyze complexity and trade-offs

Explain that the algorithm runs in O(n) time and O(1) extra space (since alphabet size is fixed). Mention alternative approaches like sorting or using a hash map, and why the two-pass method is optimal.

5. Test with examples

Walk through a few test cases, including duplicates (e.g., secret='allee', guess='apple') to demonstrate correctness. Also test edge cases like empty strings or invalid inputs.

Key Points to Mention

  • Two-pass approach to handle duplicates correctly: exact matches first, then partial matches with a frequency map.
  • Input validation: ensure strings are of equal length and contain only valid characters.
  • Time and space complexity: O(n) time, O(1) space (using fixed-size array or hash map).
  • Handling of duplicate letters: decrement frequency count when a partial match is found.
  • Edge cases: empty strings, no matches, all exact matches, repeated letters.
  • Trade-offs: using a frequency map vs. sorting; why two-pass is better than one-pass for duplicates.

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