← Google Interview Insights

Google·Software Engineer·Online Assessment (OA)·Intermediate

IntermediatePrefer not to say
Jun 2026Remote

Summary

Google SWE online assessment, two problems on HackerRank with a 90-minute total clock. The first problem was a pure implementation task dressed up as an anti-spam email verification system. Nothing tricky algorithmically, just a lot of spec details that could bite you if you skim the prompt.

Questions Asked (1)

Q1

Implement an email verification token generator: split an email body into fixed-size chunks, map each character to a numeric value using a predefined table, sum the values per chunk to get a checksum, then index into a verification string (with modular wrap if the checksum exceeds its length) to build the final token.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Looks easy and it mostly is, but the modular wrap on the verification string index is the thing that trips people up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and edge cases, then outline a step-by-step algorithm before coding. Discuss trade-offs such as time/space complexity, handling non-ASCII characters, and potential security considerations.

Pro tip: Demonstrate awareness of real-world constraints: mention that email bodies can be large, so streaming or chunking without loading the entire body into memory is preferable. Also, note that the token should be deterministic but not easily guessable, so consider adding a secret salt or using a cryptographic hash.

1. Clarify requirements and edge cases

Ask about input format (string, bytes), character set (ASCII, Unicode), chunk size, predefined mapping table, verification string, and expected output format. Discuss handling of characters not in the mapping table and empty inputs.

2. Design the algorithm

Outline steps: split email body into fixed-size chunks, map each character to its numeric value, sum values per chunk, compute modulo of sum by verification string length, and concatenate characters at those indices to form the token.

3. Analyze complexity and trade-offs

Calculate time complexity O(n) where n is body length, and space complexity O(1) extra if processing chunk by chunk. Discuss alternative approaches like using a rolling hash or precomputing sums for performance.

4. Implement and test

Write clean code with clear variable names, handle edge cases (empty body, chunk size larger than body, characters not in map), and test with sample inputs to verify correctness.

5. Discuss security and scalability

Mention that the token is deterministic and may be predictable; suggest adding a secret salt or using HMAC for security. For scalability, propose streaming processing to avoid memory issues with large emails.

Key Points to Mention

  • Time and space complexity analysis (O(n) time, O(1) extra space if streaming).
  • Handling of characters not present in the mapping table (e.g., skip, default value, or error).
  • Modular arithmetic for indexing into the verification string.
  • Determinism and potential security weaknesses (predictable tokens) and mitigations.
  • Edge cases: empty email body, chunk size zero or negative, verification string empty.
  • Scalability: processing large emails in a streaming fashion to avoid high memory usage.

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