← Google Interview Insights

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

Intermediate
Apr 2026

Summary

Google SWE online assessment, 90 minutes, two coding problems. The first was a string processing task and the second was a feature rollout evaluator with dependency resolution. An AI assistant was apparently available but your code still had to pass the unit tests, which felt like a weird middle ground.

Questions Asked (4)

Q1

Implement a function that processes an email string in fixed-size chunks, computes a checksum for each chunk using character weights, and uses that checksum to index into a verification string, returning the concatenation of all selected characters.

Algorithms & Data Structures
Author's notes

The character weight mapping tripped me up a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem details: chunk size, character weights (e.g., ASCII values), and verification string length. Then, outline an algorithm that iterates through the email in chunks, computes a weighted sum for each chunk, takes modulo the verification string length to get an index, and concatenates the characters. Finally, discuss edge cases and complexity.

Pro tip: Mention that the checksum should be taken modulo the verification string length to avoid out-of-bounds errors, and proactively discuss how to handle the last chunk if it's smaller than the chunk size.

1. Clarify requirements and assumptions

Ask about chunk size, character weights (e.g., ASCII, custom mapping), verification string length, and behavior for incomplete chunks. Confirm if checksum is sum of weights or something else.

2. Design the algorithm

Iterate over the email string in steps of chunk size. For each chunk, compute the checksum by summing the weights of its characters. Use checksum modulo verification string length to get an index.

3. Handle edge cases

Consider empty email, empty verification string, chunk size larger than email length, and last chunk with fewer characters. Decide whether to pad or process as-is.

4. Implement and test

Write clean code with meaningful variable names. Test with examples, including edge cases, and verify correctness. Analyze time and space complexity.

5. Optimize and discuss trade-offs

If needed, optimize by precomputing weights or using a sliding window. Discuss trade-offs between readability and performance.

Key Points to Mention

  • Chunking logic: how to split the string into fixed-size chunks, including handling the last chunk.
  • Checksum computation: summing character weights (e.g., ASCII values) and possibly using modulo to keep it within bounds.
  • Indexing into verification string: using checksum modulo length to avoid out-of-bounds.
  • Edge cases: empty strings, chunk size larger than string, non-ASCII characters, and verification string length zero.
  • Time and space complexity: O(n) time where n is email length, O(1) extra space (excluding output).
  • Testing strategy: unit tests for normal and edge cases, and verifying output with manual examples.

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

Q2

Given a feature rollout system with user attributes and feature rules, implement an evaluator that checks country eligibility, platform version eligibility, and dependency satisfaction in the correct order, returning a structured decision with a reason string.

Algorithms & Data StructuresSystem Design
Author's notes

The ordering requirement is what makes this annoying.

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 clean, extensible design that evaluates rules in the specified order. Implement the evaluator with a focus on correctness, readability, and testability, and discuss how to handle dependencies and version comparisons.

Pro tip: Emphasize the importance of deterministic ordering and explain how you would make the system extensible for future rule types without modifying existing code (e.g., using the Strategy pattern).

1. Clarify Requirements

Ask questions to understand the exact semantics: how country eligibility is determined (allowlist/blocklist), how platform versions are compared (semver), and what dependency satisfaction means (e.g., other features enabled).

2. Design the Evaluation Order

Define the order: country first, then platform version, then dependencies. Explain why this order matters (e.g., fail fast on cheap checks) and how to return a structured decision with a reason string.

3. Implement the Evaluator

Write a function that takes user attributes and feature rules, checks each condition in order, and returns a decision object (e.g., {eligible: bool, reason: string}). Use helper functions for each check to keep code modular.

4. Handle Edge Cases and Dependencies

Consider missing attributes, invalid versions, circular dependencies, and how to represent dependency rules. Discuss strategies like topological sorting or recursive checks with cycle detection.

5. Test and Extend

Outline unit tests for each condition and the overall flow. Mention how to extend the system with new rule types (e.g., using interfaces or strategy pattern) without breaking existing logic.

Key Points to Mention

  • Deterministic evaluation order and early exit for efficiency
  • Structured decision object with clear reason strings for debugging
  • Version comparison using semantic versioning (semver) or similar
  • Dependency resolution: direct vs. transitive, cycle detection
  • Extensibility: strategy pattern or rule engine for future rules
  • Testing: unit tests for each condition and integration tests for order

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

Q3

Parse a dependency file where each line maps a feature name to a comma-separated list of dependencies, and correctly handle whitespace trimming and empty dependency lists.

Algorithms & Data Structures
Author's notes

Sounds trivial and mostly is, except the bug they apparently plant is treating the entire comma-separated dependency list as a single string instead of splitting it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the input format and edge cases, then outline a line-by-line parsing strategy using split on commas and trimming whitespace. Emphasize handling empty dependency lists and maintaining a clean data structure like a dictionary mapping feature names to lists of dependencies.

Pro tip: Mention that you would write unit tests for edge cases like trailing commas, empty lines, and lines with only a feature name, showing you think about robustness beyond the happy path.

1. Clarify requirements and edge cases

Ask about the exact format: how are feature names and dependencies separated? Are there comments or blank lines? What about duplicate features? This ensures you understand the problem fully before coding.

2. Design the data structure

Choose a dictionary mapping feature names (strings) to lists of dependency names. Consider if order matters or if you need to handle duplicates.

3. Implement line-by-line parsing

For each line, split on the first delimiter (e.g., colon or space) to separate feature and dependencies. Trim whitespace from both parts. If dependencies part is empty, assign an empty list.

4. Handle dependency list parsing

Split the dependencies string by commas, trim each dependency, and filter out empty strings. This correctly handles trailing commas and extra spaces.

5. Test and validate

Walk through examples including empty lines, lines with no dependencies, and lines with multiple dependencies. Discuss potential errors like malformed lines and how to handle them.

Key Points to Mention

  • Use of split with a delimiter and strip() to trim whitespace
  • Handling empty dependency lists by checking if the string is empty after trimming
  • Filtering out empty strings when splitting dependencies to avoid empty entries
  • Choosing appropriate data structures (e.g., dict of lists) for efficient lookup
  • Error handling for malformed lines (e.g., missing delimiter)
  • Time and space complexity: O(n) where n is total number of characters

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

Q4

Handle cycle detection in a feature dependency graph where cycles can involve two features or longer chains, and format the cycle reason string to show the full path including the repeated node.

Algorithms & Data Structures
Author's notes

This is the hardest sub-part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use depth-first search with a recursion stack to detect cycles, maintaining the current path to capture the full cycle when a back edge is found. When a cycle is detected, format the reason string by joining the path from the first occurrence of the repeated node to the end, appending the repeated node again.

Pro tip: Clarify whether the graph is directed and if self-loops are possible, as this affects cycle detection. Also, consider using iterative DFS with an explicit stack to avoid recursion depth issues in large graphs.

1. Clarify graph properties and requirements

Ask if the graph is directed, if multiple edges exist, and confirm the expected format for the cycle reason string (e.g., 'A -> B -> C -> A').

2. Choose cycle detection algorithm

Select DFS with a recursion stack (or iterative equivalent) to detect back edges, which indicate cycles. Maintain a path list to record the current traversal.

3. Detect and capture the cycle

When visiting a node already in the recursion stack, extract the cycle from the path starting at that node's first occurrence, then append the node again to show the repetition.

4. Format the cycle reason string

Join the cycle nodes with ' -> ' and ensure the repeated node appears at both ends, e.g., 'A -> B -> C -> A'.

5. Handle edge cases and complexity

Discuss handling of self-loops, multiple cycles, and disconnected components. Mention time complexity O(V+E) and space complexity O(V).

Key Points to Mention

  • Directed graph cycle detection using DFS with recursion stack
  • Maintaining the current path to reconstruct the cycle
  • Formatting the cycle string to include the repeated node at start and end
  • Time and space complexity analysis
  • Handling of self-loops and multiple cycles
  • Iterative DFS alternative to avoid recursion limits

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