The Google DSA Sheet is a structured, production grade roadmap designed to take software engineers from fundamental data structures to the advanced algorithmic patterns tested in Google technical interviews. Google coding interviews assess analytical rigor, clean modular design, spatial and temporal trade-offs, and how you articulate invariant proofs while navigating ambiguity under time constraints.
In this comprehensive guide, you will find an exhaustive breakdown of the Google SDE hiring pipeline, the 6-step live problem solving framework, and topic-by-topic question banks featuring over 190 high-frequency problems. Each problem is categorized by its core invariant and linked directly to its deep-dive C++ implementation with step by step dry runs and mathematical complexity derivations.
🔹 Google SDE Interview Process: Complete Architecture
Google evaluates candidates across four core pillars: General Cognitive Ability (GCA), Role-Related Knowledge (RRK), Leadership, and Googliness. Understanding how each stage functions helps you allocate preparation time effectively:
- 1. Online Application & Recruiter Screen (15 to 30 min): Initial resume screening followed by a recruiter conversation covering past projects, technical stack preferences, target level (L3 / L4 / L5 / L6), and timeline logistics.
- 2. Online Assessment (OA: 90 min): Typically consists of 2 complex algorithmic challenges hosted on a standardized code evaluation platform. Focus is placed on 100% test suite pass rates, handling extreme corner cases, and zero time limit exceeded (TLE) errors.
- 3. Technical Phone Screen (45 min): Conducted over Google Meet via an online code collaboration editor without syntax highlighting or auto-completion. Expect 1 core algorithmic problem with 1 or 2 dynamic follow-up constraints.
- 4. Virtual / Onsite Interview Loop (4 to 5 rounds, 45 min each):
- Coding Rounds (3 to 4 rounds): Deep dives into data structure selection, dynamic programming, graph traversals, bit manipulation, and monotonic bounds.
- System Design / OOD (1 round for L5+ / Experienced L4): Architecture of distributed, high-throughput, fault-tolerant systems or low-level concurrent object-oriented frameworks.
- Googliness & Leadership (1 round): Behavioral assessment using the STAR framework (Situation, Task, Action, Result) focused on intellectual humility, bias for action, conflict navigation, and ambiguous problem scoping.
- 5. Hiring Committee (HC) & Team Matching: Interview feedback packets (grades from Strong Hire to Strong No Hire, candidate code, complexity proofs, and interviewer notes) are independently audited by an unbiased committee before final offer extension.
🔹 The 6-Step Google Live Problem Solving Blueprint
Google interviewers evaluate your thought process as much as the final code. Follow this systematic 45-minute execution rhythm:
- Clarify Constraints (3 to 5 min): Clarify input data types, array lengths, duplicate rules, negative values, integer overflow boundaries (32-bit vs 64-bit), and mutability constraints.
- Articulate Brute Force & Identify Bottlenecks (5 min): State the naive solution aloud, compute its Time Complexity (TC) and Space Complexity (SC), and identify the exact redundant computation causing inefficiency.
- Derive the Optimal Invariant (7 to 10 min): Propose the optimal pattern (such as Monotonic Deque, Two Pointers, Trie, or Dynamic Programming) and confirm buy-in with the interviewer before writing code.
- Write Production Grade Code (15 min): Write clean, modular, modern C++ using descriptive naming, const-correctness, proper helper functions, and safe bounds checking. Avoid global variables.
- Dry Run & Manual Trace (5 min): Walk through a non-trivial example step by step, maintaining variable state tables on screen to verify edge transitions.
- Analyze Complexity & Scale Limits (3 min): State exact Big-O metrics: O(N) time, O(1) auxiliary space. Discuss hardware level trade-offs like cache locality and branch predictability.
🔹 Basic Maths
Basic Math problems build intuition for digit manipulation, logarithmic time complexity bounds, modular arithmetic, and divisibility rules. Google frequently integrates basic math theorems into larger search and graph algorithms as pruning optimizations.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Count Digits | Easy · Math / Log10 | |
| Reverse a Number | Easy · Modulo Arithmetic | |
| Check Palindrome Number | Easy · Half-Reversal | |
| GCD / HCF | Easy · Euclidean / Stein’s | |
| Armstrong Numbers | Easy · Digit Power Precomputation | |
| Print All Divisors | Easy · Sqrt Factor Pairing | |
| Check for Prime | Easy · 6k ± 1 Primality Test |
🔹 Arrays
Arrays form the backbone of memory cache friendly algorithms. Interview problems evaluate in-place transformations, prefix/suffix parity, coordinate compression, multi-dimensional matrix traversals, and boundary peeling with strict O(1) auxiliary memory.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Counting Frequencies of Array Elements | Easy · Cyclic Modulo In-Place | |
| Highest/Lowest Frequency Element | Easy · Single-Pass Histogram | |
| Find Peak Element | Medium · Gradient Binary Search | |
| Search in Rotated Sorted Array I | Medium · Piecewise Monotonicity | |
| Search in Rotated Sorted Array II | Medium · Duplicate Boundary Pruning | |
| Find Minimum in Rotated Sorted Array | Medium · Inflection Point Search | |
| Times Array Has Been Rotated | Easy · Pivot Index Equivalence | |
| Single Element in a Sorted Array | Medium · Even-Odd XOR Index Parity | |
| Row with Maximum 1’s | Medium · Staircase Saddleback Walk | |
| Matrix Median | Hard · Binary Search on Value Space | |
| Spiral Matrix | Medium · 4-Boundary Layer Peeling | |
| Sort K-Sorted Array | Medium · Min-Heap Sliding Window | |
| Replace Each Element by Its Rank | Easy · Coordinate Compression | |
| Rotate Image (90 Degrees Clockwise) | Medium · In-Place Transpose & Reverse | |
| Search a 2D Matrix | Medium · Virtual 1D & Saddleback Search |
🔹 Strings
Strings represent sequences of characters where modern C++ optimizations, including Small String Optimization (SSO), std::string_view zero-copy slicing, and deterministic string matching algorithms (KMP, Rabin-Karp, Z-Algorithm), prove critical in Google scale assessments.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Remove Outermost Parentheses | Easy · Depth Counter Invariant | |
| Reverse Words in a String | Medium · Triple Reversal In-Place | |
| Largest Odd Number in a String | Easy · Reverse Bitwise Slicing | |
| Longest Common Prefix | Easy · Vertical Scanning | |
| Isomorphic String | Easy · Dual Direct-Mapped ASCII | |
| String Rotation Check | Easy · KMP Cyclic Matcher | |
| Anagram Check | Easy · 26-Bin Fixed Histogram | |
| Longest Substring Without Repeating Characters | Medium · Direct Jump Table | |
| Longest Substring with ≤ K Distinct Characters | Medium · Monotonic Sliding Window | |
| Minimum Window Substring / Subsequence | Hard · Frequency Match Counter | |
| Subarray with K Different Integers | Hard · Exact Difference Engine | |
| Binary Subarray With Sum | Medium · Prefix Sliding Window |
🔹 Sliding Window
Sliding Window patterns transform quadratic search algorithms into strict O(N) linear time traversals over contiguous sequences. Google heavily tests dynamic window expansion and shrinkage, auxiliary monotonic queues, and the exact difference reduction trick (atMost(K) - atMost(K - 1)).
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Sliding Window Maximum | Hard · Monotonic Decreasing Deque | |
| Minimum Size Subarray Sum | Medium · Dynamic Inward Contraction | |
| Longest Substring Without Repeating Characters | Medium · Last Occurrence Index Jump | |
| Longest Substring With At Most K Distinct Characters | Medium · Frequency State Expansion | |
| Permutation in String | Medium · Fixed Window Match Counter | |
| Find All Anagrams in a String | Medium · 26-Bin Sliding Histogram | |
| Minimum Window Substring | Hard · Two-Pointer Dynamic Squeeze |
🔹 Two Pointer
Two Pointer algorithms leverage sorted invariants, boundary bounding, or symmetric distance properties to prune multi-dimensional search spaces in linear time without extra memory allocations.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Two Sum II – Input Array Is Sorted | Medium · Inward Squeeze Invariant | |
| Valid Palindrome II | Easy · Single Branching Tolerance | |
| Container with Most Water | Medium · Area Bounding Invariant | |
| Sort Colors | Medium · Dutch National Flag 3-Way | |
| 3Sum | Medium · Sort + In-Place Skip | |
| 4Sum | Medium · Extreme Bound Pruning | |
| Partition Labels | Medium · Greedy Anchor Expansion |
🔹 Greedy
Greedy Algorithms construct optimal global solutions by making irrevocable locally optimal choices. In Google interviews, you must mathematically prove the greedy choice property and exchange arguments before writing code.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Activity Selection Problem | Easy · Earliest Finish Time First | |
| Fractional Knapsack Problem | Medium · Density Ratio Sorting | |
| Job Scheduling Problem | Medium · DSU Path Compression | |
| Minimum Number of Platforms Required | Medium · Sweep Line Event Chronology | |
| Gas Station | Medium · Deficit Accumulator Reset | |
| Candy | Hard · Peak & Valley Slope Tracking | |
| Assign Cookies | Easy · Two-Pointer Sorted Match | |
| Greedy Florist | Medium · Escalating Purchase Multiplier | |
| Rearrange Characters | Medium · Pigeonhole Stride Placement |
🔹 Linked List
Linked Lists evaluate pointer manipulation, memory leak prevention, dummy sentinel stabilization, and Floyd’s cycle finding invariants under non-contiguous heap layouts.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Insert/Delete/Search Node | Easy · Linus Torvalds Double Pointer | |
| Find Length of LL | Easy · Loop Unrolling & TCO | |
| Middle of Linked List | Easy · Floyd’s Runner Algorithm | |
| Reverse LL (Iterative & Recursive) | Easy · 3-Pointer In-Place Reversal | |
| Detect Loop, Find Start, Length of Loop | Medium · Tortoise and Hare Invariant | |
| Check Palindrome LL | Medium · Midpoint Split & Restoration | |
| Segregate Odd/Even Nodes | Medium · In-Place Leapfrogging | |
| Remove Nth Node From End | Medium · Preshifted Sliding Pointers | |
| Delete Middle Node | Medium · Pre-shifted Runner with Dummy | |
| Sort LL / Sort 0-1-2 LL | Medium · Bottom-Up Iterative Merge Sort | |
| Intersection Point of Y LL | Medium · Symmetric Distance Balancing | |
| Add 1 to Number in LL | Medium · Single-Pass Last Non-9 Tracker | |
| Add Two Numbers in LL | Medium · Full Adder Carry Propagation | |
| Delete All Key Occurrences (DLL) | Medium · Bidirectional Sentinel Unlink | |
| Reverse in Groups of K | Hard · Bottom-Up Iterative Splicing | |
| Rotate LL | Medium · Circular Ring Closure & Cut | |
| Flatten Linked List | Hard · Iterative Child Splicing | |
| Clone LL with Random Pointer | Hard · 3-Phase Interweaving & Unweaving |
🔹 Stack
Stacks govern LIFO expression evaluation and monotonic data structures. Google interviewers frequently use monotonic stacks to test how candidates maintain order invariants to bound area, range, and next-element problems in amortized O(1) time per element.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Infix ↔ Prefix / Postfix Conversions | Medium · Dijkstra Shunting-Yard | |
| Next Greater / Smaller Element (I, II) | Medium · Circular Monotonic Stack | |
| Number of NGEs to Right | Medium · Fenwick Tree / Coordinate Comp. | |
| Trapping Rainwater | Hard · Converging Two Pointers | |
| Sum of Subarray Minimums | Medium · Combinatorial PLE/NLE Bounds | |
| Stock Span Problem | Medium · Compressed Monotonic Stack | |
| Asteroid Collision | Medium · Zero-Allocation In-Place Stack | |
| Sum of Subarray Ranges | Medium · Linearity of Summation | |
| Remove K Digits | Medium · Greedy Positional Monotonicity | |
| Largest Rectangle in Histogram | Hard · Virtual Height-0 Sentinel Stack | |
| Maximal Rectangle | Hard · 2D-to-1D Dynamic DP Reduction | |
| Implement Stack Using Recursion (Sort / Reverse Stack) | Medium · Call Frame Anatomy |
🔹 Queue & Deque
Queues and Double-Ended Queues (Deques) power multi-source BFS graph traversals, sliding window monotonic structures, and foundational low-level caching architectures.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Sliding Window Maximum (Deque) | Hard · Monotonic Decreasing Deque | |
| Rotten Oranges | Medium · Multi-Source Level-Order BFS | |
| LRU Cache | Medium · Hash Map + Doubly Linked List | |
| LFU Cache | Hard · Dual Map + Frequency Lists | |
| Implement Queue Using Stacks | Easy · Amortized Double-Inversion | |
| Celebrity Problem | Medium · Two-Pointer Elimination |
🔹 Binary Search & Monotonic Predicates
Binary Search is one of Google’s most tested patterns. Beyond searching sorted arrays, interviewers focus heavily on Binary Search on Answer, where you establish a monotonic boolean feasibility function (f(x) → {true, false}) across continuous or discrete answer domains.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Binary Search to Find X | Easy · Branchless CMOV Search | |
| Lower Bound / Upper Bound | Easy · Half-Open Interval Calculus | |
| Search Insert Position | Easy · Convergence Invariant returning Low | |
| Floor / Ceil in Sorted Array | Easy · Bounded Approximation | |
| First / Last Occurrence | Medium · Boundary Reduction Invariants | |
| Count Occurrences in Sorted Array | Easy · Upper Bound – Lower Bound | |
| Binary Search on 2-D Matrix | Medium · Virtual 1D Index Mapping | |
| Square Root via Binary Search | Easy · Newton-Raphson & Halving | |
| Nth Root via Binary Search | Medium · 3-State Power Feasibility | |
| Minimum Days to Make M Bouquets | Medium · Monotonic Adjacent Predicate | |
| Koko Eating Bananas | Medium · Ceiling Division Feasibility | |
| Smallest Divisor Given Threshold | Medium · Sum Ceiling Minimization | |
| Capacity to Ship Packages in D Days | Medium · Continuous Bin Packing | |
| Aggressive Cows | Hard · Maximize Minimum Distance | |
| Book Allocation | Hard · Minimize Maximum Workload | |
| Split Array – Largest Sum | Hard · Contiguous Partition Feasibility | |
| Kth Missing Positive Number | Medium · Missing Index Calculus | |
| Minimize Max Distance to Gas Station | Hard · Continuous Precision Iteration |
🔹 Hashing & Bit Manipulation
Hashing and Bitwise Operations allow constant-time state updates, bitmask-based subset generation, and high throughput data compression without secondary heap allocations.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Hashing Theory | Easy · Open Addressing vs Separate Chaining | |
| Power Set (Bitmask ∪ Hash) | Medium · Bitwise Shift Subsets | |
| Counting Bits to Flip A→B | Easy · Kernighan’s Bitwise Popcount | |
| Number Appearing Odd Times | Easy · Cumulative XOR Cancellation | |
| XOR of Numbers L to R | Medium · Modulo-4 Closed Form Formula | |
| Two Numbers Appearing Odd Times | Medium · Rightmost Set Bit Partition |
🔹 Recursion
Recursion establishes base cases and inductive recurrence relations. Google evaluates stack depth management, Tail-Call Optimization (TCO), and branch tree visualizations.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Print Numbers from 1 to N | Easy · Head vs Tail Recursion | |
| Factorial | Easy · Recurrence Relations | |
| Fibonacci Number | Easy · Matrix Exponentiation / Binet | |
| Sum of Digits | Easy · Recursive Modulo Reduction | |
| Tower of Hanoi | Medium · Divide and Conquer Invariant |
🔹 Backtracking
Backtracking explores exponential search spaces with aggressive pruning. In Google interviews, focus on state hashing, branch bounding, and in-place state restoration without copying auxiliary containers.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| N-Queens | Hard · Bitmask Diagonal Bounding | |
| Sudoku Solver | Hard · 9×9 Bitmask Constraint Grid | |
| Rat in a Maze | Medium · 4-Directional DFS Pruning | |
| Word Search | Medium · In-Place Grid Character Masking | |
| Combination Sum | Medium · Unbounded Choice Subtree | |
| Permutations | Medium · In-Place Swap Backtracking | |
| Subsets | Medium · Cascading Power Set Generation |
🔹 Dynamic Programming
Dynamic Programming (DP) resolves overlapping subproblems with optimal substructure. Google interviewers place high emphasis on 1D space compression, multi-dimensional grid DAGs, partition DP, and optimizing O(N²) transitions into O(N log N) bounds using binary search or monotonic queues.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Climbing Stairs / Frog Jump | Easy · 1D Rolling State Machine | |
| Maximum Sum of Non-Adjacent (House Robber) | Medium · 2-State Decision DP | |
| LIS (Classic & Binary Log N) | Medium · Patience Sorting & Bounds | |
| Coin Change | Medium · Unbounded Knapsack DP | |
| Unique Paths | Medium · 2D Grid Rolling Buffer | |
| Edit Distance | Hard · 2D Levenshtein Alignment | |
| DP on Grids (Max Rectangle, Count Squares) | Hard · Histogram Reduction DP | |
| DP on Stocks (Buy & Sell Variants) | Medium · Multi-State Transition Machines | |
| Matrix Chain / Partition DP | Hard · Interval Splitting Invariant | |
| Subset & Subsequence Patterns | Medium · 0/1 Knapsack Boolean Vector | |
| Palindrome Partitioning | Hard · 2D Palindrome Table + Partition | |
| Word Break | Medium · Trie + Boolean DP Vector | |
| Expression Add Operators | Hard · Running Value & Mult Tracker | |
| N Queen | Hard · State Bitmask Bounding | |
| Rat in Maze | Medium · Visited Bitmask DP | |
| M Coloring | Medium · Graph Adjacency State Vector | |
| Sudoku Solver | Hard · Exact Cover / Constraint Matrix |
🔹 Tree & Binary Search Tree
Trees and BSTs test hierarchical modeling, recursive divide-and-conquer, Morris in-order traversals (achieving O(1) space without call stack overhead), and tree serialization techniques.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Root-to-Node Path | Easy · Backtracking Vector Path | |
| LCA (Binary Tree & BST) | Medium · Structural Branch Convergence | |
| Maximum Width of Binary Tree | Medium · BFS Coordinate Indexing | |
| Children Sum Property | Medium · Top-Down Bottom-Up Squeeze | |
| Nodes at Distance K | Medium · Parent Pointer Map + BFS | |
| Burn Binary Tree | Hard · Fire Propagation Wavefront | |
| Count Nodes in Complete Binary Tree | Medium · Height Comparison Subtree Halving | |
| Construct Tree (Inorder + Pre/Post) | Medium · Index Hash Map Divide & Conquer | |
| Serialize / Deserialize Binary Tree | Hard · Level-Order Sentinel Parsing | |
| Morris Preorder / Inorder | Hard · Threaded Binary Tree Invariant | |
| Flatten Binary Tree to LL | Medium · Right Pointer In-Place Splicing | |
| Search / Insert / Delete in BST | Medium · Recursive Ordering Invariant | |
| Ceil / Floor in BST | Easy · Iterative Branch Traversal | |
| Kth Smallest / Largest in BST | Medium · Augmented In-Order Traversal | |
| Check Valid BST | Medium · Lower/Upper Bound Interval | |
| Construct BST from Preorder | Medium · Monotonic Upper Bound Invariant | |
| Inorder Successor / Predecessor | Medium · BST Property Step-Down | |
| Merge Two BSTs | Hard · Flat In-Order Merge / Doubly LL | |
| Two-Sum in BST | Medium · Dual BST Iterator Squeeze | |
| Recover Swapped BST | Hard · In-Order Misplacement Detection | |
| Largest BST in Binary Tree | Hard · Bottom-Up Quad Tuple Validation |
🔹 Heap & Priority Queue
Heaps maintain complete binary tree properties to deliver logarithmic insertions and constant time access to extreme elements. Key Google applications include streaming medians, K-way merges, and scheduling rate limiters.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Intro to Priority Queue / Min vs Max Heap | Easy · Sift-Up & Sift-Down Mechanics | |
| Check Array Is Min-Heap | Easy · Child Index Verification | |
| Convert Min Heap to Max Heap | Easy · Bottom-Up Heapify | |
| Merge M Sorted Lists | Hard · Min-Heap K-Way Convergence | |
| Sort K-Sorted Array (Heap) | Medium · Sliding Window Min-Heap | |
| Kth Largest/Smallest via Heap | Medium · Fixed Size Heap Bounding | |
| Task Scheduler | Medium · Max-Heap Frequency Bounding | |
| Hands of Straights | Medium · Min-Heap Frequency Eviction | |
| Find Median From Data Stream | Hard · Dual Min-Max Balanced Heaps |
🔹 Graph
Graphs model interconnected dependencies across complex topologies. Google frequently tests Multi-Source BFS, Topological Sort (Kahn’s Algorithm), Disjoint Set Union (DSU) with rank and path compression, Shortest Path algorithms (Dijkstra, Bellman-Ford), and Tarjan’s bridges.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Graph Representation & Traversals (BFS/DFS) | Easy · Adjacency List & Flat Arrays | |
| Number of Provinces | Medium · Connected Component DFS / DSU | |
| Connected Components in Matrix | Medium · 2D Grid Visited Bitmask | |
| Flood Fill / Number of Enclaves | Medium · Boundary-Initiated Multi-Source BFS | |
| Rotten Oranges (Graph BFS) | Medium · Wavefront Level-Order BFS | |
| Cycle Detection (Undirected & Directed) | Medium · Parent Tracking & Recursion Stack | |
| 0/1 Matrix | Medium · Reverse Multi-Source BFS | |
| Surrounded Regions | Medium · Boundary Inversion DFS | |
| Word Ladder I & II | Hard · Bidirectional BFS & Backtracking | |
| Distinct Islands | Medium · DFS Path Signature Hashing | |
| Bipartite Check | Medium · 2-Coloring BFS / DFS | |
| Topological Sort / Kahn’s Algo | Medium · In-Degree Queue Reduction | |
| Course Schedule I & II | Medium · Cycle Detection in DAG | |
| Eventual Safe States | Medium · 3-Coloring Cycle Invariant | |
| Alien Dictionary | Hard · Character Precedence DAG | |
| Dijkstra Variants (Network Delay Time) | Medium · Min-Heap Distance Relaxation | |
| Minimum Spanning Tree (Prim / Kruskal) | Hard · DSU Edge Weight Greed | |
| Disjoint Set Problems (Accounts Merge) | Medium · DSU Path Compression | |
| Bridges, Articulation Point, Kosaraju | Hard · Tarjan’s Low-Link Discovery |
🔹 Trie (Prefix Tree)
Trie structures provide O(L) prefix lookups and bitwise indexing. Google interviews regularly feature Tries combined with bitwise XOR trees and auto-complete prefix search engines.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Implement Trie (Insert, Search, Delete) | Medium · Fixed 26-Array Child Nodes | |
| Longest Common Prefix Using Trie | Medium · Single Branch Traversal | |
| Count Words Matching a Prefix | Medium · Augmented Prefix Counters | |
| Replace Words | Medium · Shortest Prefix Lookup | |
| Maximum XOR of Two Numbers in Array | Hard · 32-Bit Binary Trie Squeeze | |
| Concatenated Words | Hard · Trie DFS Memoization | |
| Word Squares | Hard · Symmetric Prefix Backtracking |
🔹 Math & Numeric Edge Cases
Advanced Arithmetic problems test integer overflow handling, fractional representations, Fast Binary Exponentiation, and arbitrary precision arithmetic.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| Happy Number | Easy · Floyd’s Cycle Detection on Sums | |
| Pow(x, n) | Medium · Fast Binary Exponentiation | |
| Multiply Strings | Medium · BigInt Positional Full Adder |
🔹 System Design & Low-Level Coding (OOD)
Object-Oriented Design (OOD) & Low-Level Design (LLD) rounds evaluate concurrency controls, cache eviction policies, thread safety, and cache alignment invariants.
| Problem | Pattern / Difficulty | Solution |
|---|---|---|
| LRU Cache Design | Medium · O(1) Sentinel DLL + Hash Map | |
| Thread-Safe LRU Cache | Hard · Cache-Line Isolated Sharding | |
| Design Twitter | Medium · Fan-Out & K-Way Timeline Merge | |
| Time-Based Key-Value Store | Medium · Hash Map + Upper Bound BS | |
| Thread-Safe Task Queue | Medium · Mutex Condition Variable Backpressure | |
| Lock-Free SPSC Ring Buffer | Hard · Atomic Acquire-Release Semantics |
🔹 Google-Ready C++ Production Template
Below is a standardized modern C++ implementation illustrating how Google interviewers expect candidate code to look: const-correct, modular, properly guarded against integer overflows, and containing zero dynamic memory overhead:
#include <iostream>
#include <vector>
#include <string_view>
#include <algorithm>
#include <cstdint>
class GoogleSolutionEngine {
public:
// Demonstrating clean, const-correct optimal monotonic sliding window
[[nodiscard]] static int minSubArrayLen(int target, const std::vector<int>& nums) noexcept {
const int n = static_cast<int>(nums.size());
int left = 0;
int64_t currentSum = 0;
int minLength = n + 1;
for (int right = 0; right < n; ++right) {
currentSum += nums[right];
while (currentSum >= target) {
minLength = std::min(minLength, right - left + 1);
currentSum -= nums[left++];
}
}
return (minLength <= n) ? minLength : 0;
}
};
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
const std::vector<int> testCase = {2, 3, 1, 2, 4, 3};
const int target = 7;
const int result = GoogleSolutionEngine::minSubArrayLen(target, testCase);
std::cout << "Optimal Minimal Subarray Length: " << result << "\n";
return 0;
}
Output
Optimal Minimal Subarray Length: 2
Takeaway: Writing clear, exception-safe code with zero unnecessary heap allocations signals strong engineering maturity during Google interview evaluations.
Try it yourself
- Time box yourself to solve 2 problems daily using a plain text editor with no syntax highlighting or code completion.
- Articulate the brute force approach aloud before implementing the optimal O(N) or O(log N) solution.
- Draft a manual variable trace table for at least one tricky corner case before stating that your solution is complete.
🔹 Google Interview Preparation Roadmap
Consistency and pattern mastery yield the highest return on investment for technical interview preparation. Follow this structured multi-week schedule:
- Weeks 1 to 2 (Linear Foundations): Master Arrays, Two Pointers, Strings, and Sliding Window. Internalize in-place pointer manipulation and direct ASCII jump tables.
- Weeks 3 to 4 (Logarithmic & Monotonic Structures): Solve all Binary Search on Answer questions, Monotonic Stacks, and Monotonic Deques.
- Weeks 5 to 6 (Hierarchical Data & Pruning): Build Trees, BSTs, Heaps, and Backtracking solvers. Practice writing recursive base conditions cleanly.
- Weeks 7 to 8 (Graphs & Dynamic Programming): Implement Topological Sort (Kahn’s), Multi-Source BFS, DSU, and 2D Grid DP with state reduction.
- Weeks 9 to 10 (System Design & Mock Interviews): Simulate 45-minute live interviews with peers or mentors. Practice answering behavioral Googliness scenarios using the STAR framework.
🔹 FAQs on Google SDE Interview Preparation
Q1: How many total problems should I master before interviewing at Google?
Quality and pattern recognition are vastly more important than volume. Solving 150 to 200 well chosen problems across all core algorithmic paradigms (with full understanding of why optimal invariants work) provides complete coverage for Google SDE II (L4) and Senior SDE (L5) loops.
Q2: Is C++ preferred over Python or Java in Google interviews?
Google is language agnostic during technical interviews. However, using modern C++ (C++17/20) allows you to demonstrate deep understanding of cache spatial locality, memory safety, pointer mechanics, and standard library internal complexities (such as std::vector geometric growth or std::unordered_map bucket collision resolution).
Q3: What if I do not arrive at the optimal solution within 45 minutes?
Interviewers evaluate your problem solving trajectory. If you start with a functional brute force solution, articulate clear trade-offs, incorporate hints constructively, and write clean, bug-free code for a sub-optimal approach, you can still receive a positive evaluation.
Q4: How important is discussing Time and Space Complexity?
Complexity analysis is mandatory. You must state both the worst-case Time Complexity and auxiliary Space Complexity using Big-O notation, explicitly explaining why the upper bound holds (for example, amortized analysis via the potential method for Monotonic Stacks).
Q5: What is the best way to handle interviewer hints?
Treat interviewers as technical collaborators. When given a hint, pause for 10 to 15 seconds to synthesize the suggestion, link it back to your current data structure or invariant, and explain aloud how the hint alters your search space or eliminates redundant computations.
Q6: How does Google evaluate Googliness and behavioral rounds?
Googliness measures how you navigate ambiguity, collaborate across cross-functional teams, demonstrate intellectual humility, admit mistakes, and prioritize user impact. Frame your answers using the STAR method (Situation, Task, Action, Result) with quantified real-world outcomes.
🔹 Wrapping Up
The Google DSA Sheet provides a structured foundation for mastering technical interviews at top tier technology companies. Work through each topic sequentially, write complete implementations in your local editor, and verify the memory and time trade-offs of every solution. Bookmark this hub as your primary preparation dashboard and explore our dedicated deep-dive tutorials on DSA and C++ Engineering.