Contribute OA questions
OAHelper
CompaniesProblemsTopicsInterview Experiences
Explore
G

Google

SDE

Interview Date

17-08-2026

Result

Rejected

Difficulty

Medium

Rounds

01

Drive Type

Off-Campus

Interview Date

17-08-2026

Result

Rejected

Difficulty

Medium

Rounds

01

Drive Type

Off-Campus

Topics asked

DSA

Detailed experience

The interviewer opened with an algebraic topology and combinatorial graph-theoretic scenario: "Given an undirected simple graph G with n vertices and m edges, determine its Betti Numbers over Z_2—specifically, compute the exact 1-dimensional cycle homology group H_1(G, Z_2) and find a Minimum Cycle Basis (MCB) where the total weight of the chosen basic cycles is minimized, in O(m^2 * n / log n) or O(m^2 * n) deterministic time without exponential cycle enumeration." I observed that finding an arbitrary cycle basis is trivial via the fundamental cycles of a spanning forest (yielding dimension m - n + c), but fundamental cycles can be arbitrarily long and do not necessarily form a minimum-weight basis. I proposed Horton’s Algorithm accelerated via Mehlhorn-Michail or Kavitha’s Signed Graph Shortest Path Search. The interviewer followed up: "Horton proved that any cycle in a minimum cycle basis is the symmetric difference of two shortest-path trees sharing an edge; explain why this limits candidate cycles to O(m * n), and how Gaussian elimination over GF(2) or the de Pina independence test extracts the basis in polynomial time." I explained that for any cycle C in an MCB and any vertex v on C, the cycle decomposes into P(v, u) + P(v, w) + (u, w), where P(v, u) and P(v, w) are shortest paths from v. Thus, by running Dijkstra from every vertex v, we generate at most m candidate cycles per vertex, forming a candidate pool of at most m * n cycles. To extract the minimum weight independent subset of cycles over the vector space GF(2)^m, running naive Gaussian elimination takes O((m * n) * m^2), which is O(m^3 * n). Instead, we use de Pina’s approach: we maintain a set of orthogonal witness vectors S_1, ..., S_{m - n + 1} in GF(2)^m initialized to the standard basis. At each of the k = m - n + 1 rounds, we find the shortest cycle C in the candidate pool that has an odd inner product with witness vector S_k (i.e., C · S_k = 1 mod 2), which guarantees that C is linearly independent of previously chosen cycles. Once C is added to the basis, we update the remaining witness vectors S_{k+1}, ..., S_{m - n + 1} via rank-1 updates in O(m) time per vector. Repeating this across all rounds constructs the exact Minimum Cycle Basis in O(m^2 * n) time and O(m * n) space. He then shifted to a computational geometry and kinetic geographic information systems (GIS) scenario: "Given n stationary points in R^2 representing facility sites, preprocess them to answer Reverse Nearest Neighbor (RNN) queries—given an online query point q, return all sites p_i such that q is the closest site to p_i under Euclidean distance—in O(log n + k) time per query where k is the output size, using near-linear space." I noted that Voronoi diagrams answer standard nearest neighbor queries (who is closest to q?), but the reverse relation (to whom is q the closest?) is asymmetric and non-local. I proposed using the Delaunay Triangulation combined with Bounded Angular Sector Voronoi Peeling (the Stojmenovic-Stojnakovic Sector Property) and Dynamic Half-Plane Range Trees. The interviewer cut in: "A site p_i can have q as its nearest neighbor only if no existing site is closer to p_i than ||p_i - q||; prove that the maximum number of points that can share the same reverse nearest neighbor in R^2 is at most 6 (the kissing number), and show how this geometric property limits the search space." I explained that if six or more sites had q as their mutual nearest neighbor, then by the Pigeonhole Principle, at least two sites p_a and p_b must subtend an angle of at most 60 degrees (pi / 3) at q. In the triangle formed by q, p_a, and p_b, if angle(p_a, q, p_b) < 60 degrees, the distance ||p_a - p_b|| is strictly smaller than max(||q - p_a||, ||q - p_b||), meaning that either p_a is closer to p_b than to q, or p_b is closer to p_a than to q, which contradicts q being the nearest neighbor to both. Therefore, the out-degree of any RNN query point in R^2 is strictly bounded by 6 (or at most 5 if equidistant ties are broken). To answer queries in O(log n + k) time: we divide the space around candidate points into six 60-degree cones. For each cone, the nearest neighbor condition reduces to an empty-region search: site p is an RNN of q if and only if q lies inside the Voronoi-like influence cell I(p) = {x : ||x - p|| < min_{s != p} ||s - p||}. The region I(p) is an open disk of radius equal to p's distance to its nearest neighbor in the static set (computed via Delaunay Triangulation in O(n log n) time). An online RNN query for q is therefore dual to Point Enclosure Querying over n disks: find all precomputed disks that contain query point q. Storing these disks in a dynamic 2D segment/range tree answers the enclosure query in O(log n + k) time and O(n) space. For the final challenge, he introduced an algebraic combinatorics and succinct compressed data structure problem: "Given an arbitrary static tree T with n nodes, represent T in exactly 2n + o(n) bits of memory (succinct representation) such that you can query the Lowest Common Ancestor (LCA), Depth, Subtree Size, and the k-th Child of any node in strict O(1) worst-case time, without storing pointer words." I pointed out that standard pointer-based tree representations take 3 * 64 * n bits (roughly 192n bits), which blows up memory on massive tree corpora like XML or taxonomic phylogenies. I proposed using the Succinct Balanced Parentheses (BP) representation or Ordinal Trees via Depth-First Parity Sequences (DFPS) supported by Range Minimum Queries (RMQ). The interviewer challenged me: "Walk me through how a DFS traversal encodes T into a 2n-bit balanced parentheses sequence, and explain how the core operations findclose(i), findopen(i), and enclose(i) reduce tree LCA and parent queries to O(1) time over succinct rank/select blocks." I broke down the algebraic reduction: we perform a depth-first traversal of T, writing '(' when visiting a node for the first time and ')' when backtracking from it. This produces a balanced parentheses bitstring B of length exactly 2n. Each node v in T is uniquely identified by the index of its opening parenthesis in B. In this representation: (1) `parent(i)` is given by `enclose(i)` (the index of the innermost parentheses pair that encloses index i); (2) `subtree_size(i)` is strictly `(findclose(i) - i + 1) / 2`; (3) `depth(i)` equals `rank_((i) - rank_)(i)`. The fundamental structural primitive is the excess function E(i) = rank_((i) - rank_)(i). Finding `findclose(i)` corresponds to finding the earliest position j > i where E(j) = E(i) - 1. Finding `enclose(i)` corresponds to the closest preceding index j < i with E(j) = E(i) - 1. Finding the LCA of two nodes u and v (where u < v in B) corresponds to the node associated with the minimum excess value in the interval [u, v]: LCA(u, v) = `parent(rmq_E(u, v) + 1)`. To support `findclose`, `findopen`, `enclose`, and `rmq_E` in O(1) time: we partition the excess array E into mini-blocks of size O(log^2 n) and micro-blocks of size O(log n / 2). Macro-level ranges store explicit precalculated minima, while micro-blocks are resolved via a universal precomputed lookup table of size O(sqrt(n) * poly(log n)) bits. This requires only 2n + o(n) total bits of storage, supporting all navigational and LCA queries in strict O(1) worst-case time.

Posted on - 25 Sept 2026
Company OAsAll ProblemsTopicsCompany InsightsOA CalendarInterview ExperiencesPremium
OAHelper

Built by students, for students - practice company-specific OAs, DSA sheets, and real interview experiences to land your dream role.

© 2026 OAHelper.in·Terms·Privacy·Refunds·Trust & Safety·Contact·
Ready to crack your next OA?

Practice company-specific questions trusted by thousands of students across India.

Start PracticingGo Premium
OA Practice·DSA·Placements

Disclaimer: OAHelper is an independent educational platform. We (oahelper.in) do not own the images or questions shown. Content is uploaded by users.