Contribute OA questions
OAHelper
CompaniesProblemsTopicsInterview Experiences
Explore
G

Google

SDE

Interview Date

17-08-2026

Result

Rejected

Difficulty

Hard

Rounds

01

Drive Type

Off-Campus

Interview Date

17-08-2026

Result

Rejected

Difficulty

Hard

Rounds

01

Drive Type

Off-Campus

Topics asked

DSA

Detailed experience

The interviewer opened with an advanced algebraic geometry and matrix rank scenario: "Given an undirected simple graph G with n vertices and m edges, determine whether G contains a Feedback Vertex Set (FVS) of size at most k in randomized polynomial time parameterized by k (an FPT algorithm), without using branch-and-reduce bounded search trees." I noted that the standard deterministic FPT search tree or iterative compression runs in O(4^k * k * n^2), which carries massive constant factors and complex reduction rules. I proposed the Cygan-Kratsch-Pilipczuk Matroid / Algebraic Reduction via the Lovász Matroid Parity and Gammoids framework over finite fields. The interviewer followed up: "FVS asks to eliminate cycles, while matroids naturally capture cycle-free forests (graphic matroids); how do you invert this dependency to transform vertex removal into linear independence in an algebraic representation?" I explained that a vertex set S is an FVS if and only if G \ S is a forest. By the dual formulation, selecting a forest of n - k vertices that is induced by V \ S corresponds to finding a maximum independent set in a 2-polymatroid or a linear matroid representation of an induced graphic matroid. We associate every vertex v with a 2-dimensional subspace in a linear space over a finite field F_p (with p > 2^k * n). Using the formulation of the Cauchy-Binet formula and exterior products, we map each vertex v to a pair of columns in a matrix such that selecting a subset of k vertices corresponds to choosing k column-pairs that avoid linearly dependent wedges. By the Schwartz-Zippel Lemma, substituting random field values preserves linear independence with probability at least 1 - O(n / p). This reduces the combinatorial cycle-elimination problem to finding a maximum-weight linear matroid parity basis in O(k^3 * n + m) time, achieving a randomized FPT test without recursive branching. He then shifted to a computational geometry and dynamic data structure challenge: "Design a data structure that maintains a dynamic set of n points in the 2D plane under point insertions and deletions in polylogarithmic time, such that given a query rectangle [x_1, x_2] x [y_1, y_2], you can count the exact number of points inside the query box in O(log n / log log n) time per query." I pointed out that standard 2D Range Trees with fractional cascading achieve O(log n) query time, but fractional cascading requires static arrays that break under dynamic point updates, while traditional dynamic nested balanced BSTs incur O(log^2 n) query time. I proposed the Chazelle-van Emde Boas Hybrid: a Range Tree augmented with Dynamic Bit-Parallel Weight-Balanced B-Trees (Q-Heaps / Willard's structure) or the Larsen-Pǎtraşcu Lower-Bound Matching Structure. The interviewer cut in: "The cell-probe lower bound for 2D orthogonal range reporting/counting is Omega(log n / log log n); walk me through how the primary and secondary tree branching factors are set, and how word-level parallelism compresses secondary queries." I explained that we organize the primary tree as an a-b tree (or Weight-Balanced B-Tree) over the x-coordinates with a branching factor B = Theta(log^c n) for a small constant c. Each internal node v spans a contiguous x-interval and maintains a secondary data structure over the y-coordinates of all points in its subtree. Instead of a standard BST, the secondary structure is maintained using a compacted Word-RAM structure: points are partitioned into rank intervals of size w (where w = 64 is the machine word size). Within each secondary node, the sub-interval counts are maintained as packed fields in 64-bit integer words. A query [x_1, x_2] x [y_1, y_2] decomposes into O(log_B n) = O(log n / log log n) canonical subtrees in the primary tree. In each canonical node, querying the y-interval [y_1, y_2] evaluates the prefix counts via bitwise shifts, masks, and the `popcount` (Hamming weight) machine instruction in O(1) time per node. Summing across all O(log n / log log n) levels resolves the exact range count in strict O(log n / log log n) query time, supporting insertions and deletions in O(log^{1 + epsilon} n) time. For the final challenge, he introduced an algebraic spectral graph theory problem on matrix polynomials and random walks: "Given an undirected unweighted graph G with n vertices and m edges, compute the exact Kemeny's Constant of G—the expected time for a random walk starting from an arbitrary vertex to reach a destination vertex chosen uniformly at random according to the stationary distribution—in O(n^3) time without simulating random walks." I noted that simulating millions of random walk trajectories yields only an empirical approximation with high variance. I framed Kemeny's Constant through the Spectrum of the Random Walk Transition Matrix P = D^(-1) * A and the Group Inverse of the normalized Laplacian. The interviewer challenged me: "Kemeny's Constant is invariant with respect to the start vertex—prove this invariance using the eigenvalues of P, and show how the pseudo-inverse traces yield the exact scalar in O(n^3) operations." I broke down the algebraic derivation: let P be the transition matrix with eigenvalues 1 = lambda_1 > lambda_2 >= ... >= lambda_n >= -1. The hitting time from vertex i to j is denoted H(i, j). Kemeny's Constant is defined as K = sum_j pi_j * H(i, j), where pi is the stationary distribution vector. Remarkably, K is completely independent of the starting vertex i. In terms of the fundamental matrix Z = (I - P + 1 * pi^T)^(-1), the constant is algebraically identical to K = Tr(Z) - 1. Using the spectral decomposition of P, the trace of Z maps directly to the sum of the eigenvalues: Tr(Z) = 1 + sum_{i=2}^n 1 / (1 - lambda_i), which means Kemeny's Constant equals strictly K = sum_{i=2}^n 1 / (1 - lambda_i). To compute this in O(n^3) time, we construct the normalized Laplacian L_sym = I - D^(-1/2) * A * D^(-1/2). The eigenvalues of L_sym are exactly mu_i = 1 - lambda_i. Thus, Kemeny's Constant is given by K = sum_{i=2}^n (1 / mu_i). We compute the characteristic polynomial of L_sym via Hessenberg reduction or evaluate Tr(L_sym^+) using the Moore-Penrose pseudoinverse obtained from singular value decomposition (SVD) or Gaussian elimination in O(n^3) time and O(n^2) space, recovering the exact closed-form hitting-time constant.

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.