← Google Interview Insights

Google·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Google SWE interview where they handed me a broken feature enablement system and told me to find and fix the bugs. AI tooling was allowed during debugging which was a nice change, but the problem itself had enough moving parts that I was still sweating through it.

Questions Asked (1)

Q1

You're given a buggy implementation of a feature enablement system. A config file declares features and their dependencies. Given a user, their country, OS version, pre-enabled features, and a list of requested features, fix the code so it correctly grants requests only when: the user meets country and OS restrictions for all requested features, all transitive dependencies are satisfied, and there are no cycles in the dependency graph.

Algorithms & Data StructuresSystem DesignRoot Cause Analysis
Author's notes

Three separate correctness conditions and I had to untangle which bugs corresponded to which.

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 systematic approach: parse the config, build a dependency graph, detect cycles, and perform a DFS/BFS to check eligibility and dependencies for each requested feature. Finally, discuss how you would test the solution and handle potential issues like missing features or conflicting dependencies.

Pro tip: Emphasize the importance of cycle detection and transitive dependency resolution; mention that you would use a topological sort or DFS with visited states to avoid infinite loops and ensure all dependencies are checked efficiently.

1. Clarify Requirements and Edge Cases

Ask questions to understand the exact constraints: Are dependencies only direct or transitive? What if a requested feature is already pre-enabled? How should missing features be handled? What about multiple users or batch requests?

2. Design Data Structures and Algorithm

Propose representing features as nodes in a directed graph, with edges from a feature to its dependencies. Use a map for feature definitions and a set for pre-enabled features. Outline a DFS-based approach to check eligibility and dependencies, with cycle detection.

3. Implement Core Logic

Write pseudocode or explain the steps: For each requested feature, check country and OS restrictions; then recursively check all dependencies, ensuring they are either pre-enabled or also requested and eligible. Use a visited set to detect cycles and avoid redundant checks.

4. Handle Edge Cases and Errors

Discuss how to handle missing features, cycles, and unsatisfied dependencies. Decide whether to fail the entire request or grant partially. Explain how to report errors clearly.

5. Test and Validate

Outline test cases: simple grants, country/OS mismatches, missing dependencies, cycles, and pre-enabled features. Suggest unit tests and possibly a brute-force comparison for small cases.

Key Points to Mention

  • Graph representation of features and dependencies
  • Cycle detection using DFS with recursion stack or topological sort
  • Transitive dependency resolution via recursive DFS or BFS
  • Checking country and OS restrictions for each feature
  • Handling pre-enabled features and avoiding redundant checks
  • Error handling for missing features or unsatisfiable requests

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