Contribute OA questions
OAHelper
CompaniesProblemsTopicsInterview Experiences
Explore
G

Google

SDE

Interview Date

15-08-2026

Result

Rejected

Difficulty

Medium

Rounds

01

Drive Type

Off-Campus

Interview Date

15-08-2026

Result

Rejected

Difficulty

Medium

Rounds

01

Drive Type

Off-Campus

Topics asked

DSA

Detailed experience

The interviewer opened with an advanced algebraic graph theory and lattice geometry challenge: "Given an undirected simple graph G with n vertices and m edges, determine its Exact Maximum Cut in O(2^{m/2} * poly(n)) or O(2^{0.5 m}) time without running naive O(2^n) subset enumeration, and explain how the problem maps to finding the closest vector in an integral lattice or linear code." I pointed out that Max-Cut is NP-hard, and when m < 2n (sparse graphs), an algorithm parameterized by the number of edges m rather than vertices n breaks the classic exponential barrier. I proposed using the Branch-Decomposition / Treewidth of the Dual Edge Graph combined with Algebraic Fast Walsh-Hadamard Transform (FWHT) on Cut Vectors (the Scott-Sorkin / Williams split-and-list framework). The interviewer followed up: "Any cut in G corresponds to a vector in the cut space B(G) over GF(2); walk me through how partitioning the edge set into two equal halves E_1 and E_2 transforms the maximum cut objective into a maximum inner-product / nearest-neighbor search in Hamming space, and how Walsh transforms evaluate this in O(2^{m/2}) time." I explained that let E = E_1 \cup E_2 with |E_1| = |E_2| = m/2. Any vertex cut S \subseteq V induces an incidence vector on edges x \in \{0, 1\}^m where x_e = 1 if edge e crosses the cut, and 0 otherwise. The cut objective is to maximize the Hamming weight wt(x) over all x in the cut space B(G). We can decompose any valid cut vector x into x = (x_1, x_2) where x_1 \in \{0, 1\}^{m/2} represents edges in E_1 and x_2 \in \{0, 1\}^{m/2} represents edges in E_2. The incidence of vertices on boundary edges between E_1 and E_2 introduces linear parity constraints over GF(2). We generate the list of all realizable partial cut configurations on E_1, represented as a vector f \in \mathbb{R}^{2^{m/2}} where f[x_1] = wt(x_1) if x_1 is realizable under a valid vertex assignment, and -\infty otherwise. Similarly, we define g[x_2] for E_2. The global maximum cut is \max_{x_1 \oplus x_2 \in C} (f[x_1] + g[x_2]). By lifting the parity constraints into group characters over \mathbb{Z}_2^{m/2}, evaluating this convolution is equivalent to circular correlation over the boolean hypercube. Applying the Fast Walsh-Hadamard Transform (FWHT) in O(m \cdot 2^{m/2}) time transforms the addition into pointwise spectral operations. Taking the inverse FWHT extracts the global maximum cut weight across all edges in strict O(2^{m/2} \cdot \text{poly}(n)) deterministic time and O(2^{m/2}) memory. He then shifted to a computational geometry and kinetic dynamic partition problem: "Given n stationary line segments in R^3, compute their 3D Davenport-Schinzel Upper Envelope—the pointwise maximum z-coordinate function z = F(x, y) = \max_i z_i(x, y)—and bound the exact combinatorial complexity of the projected planar map, designing an algorithm to construct it in O(n^{2 + \epsilon}) time without computing the O(n^3) arrangement." I pointed out that while the lower envelope of segments in 2D has complexity O(n \alpha(n)), lifting segments or triangular facets to 3D produces a bivariate lower envelope whose projection onto the xy-plane consists of curved and straight boundary edges. I proposed using the Overmars-Sharir Divide-and-Conquer Envelope Construction combined with Random Shattering and Cylindrical Algebraic Decomposition. The interviewer cut in: "Two non-vertical 3D segments project to lines in the plane that intersect at a single point; write down the algebraic conditions under which three segments generate a ternary envelope vertex, and explain why the Halperin-Sharir bound limits the complexity to O(n^{2 + \epsilon}) instead of O(n^3)." I broke down the algebraic geometry of the envelope: a vertex on the upper envelope in R^3 corresponds to a point where the envelope's height is determined simultaneously by three distinct segments (or two segments and a boundary endpoint). Algebraically, let the 3D lines containing segments e_1, e_2, e_3 be parameterized by linear equations. A ternary vertex occurs at a point (x, y) where the vertical line through (x, y) intersects all three segments at identical or occluding z-heights: z_{e_1}(x, y) = z_{e_2}(x, y) > z_{e_3}(x, y). Naively, any triplet of segments could form such a vertex, suggesting \Theta(n^3) vertices. However, by the Halperin-Sharir theorem on arrangements of bivariate algebraic surfaces, the upper envelope of n low-degree algebraic surface patches or segments in R^3 has combinatorial complexity at most O(n^{2 + \epsilon}) for any \epsilon > 0. To construct it in O(n^{2 + \epsilon}) time, we partition the segments into two subsets of size n/2, recursively compute the upper envelopes \mathcal{U}_1 and \mathcal{U}_2, and compute their overlay \min(\mathcal{U}_1, \mathcal{U}_2). The overlay boundaries are the 2D curves along which \mathcal{U}_1(x, y) = \mathcal{U}_2(x, y). Using a vertical line sweep on the projected planar map, we trace these intersection curves: each curve corresponds to the intersection of two ruled surfaces, having algebraic degree at most 2. We resolve all dynamic event horizons in strict O(n^{2 + \epsilon}) time and O(n^{2 + \epsilon}) space. For the final challenge, he introduced an algebraic combinatorics and compressed sequence structure scenario: "Given an arbitrary string s of length n, construct its Compact Suffix-Directed Acyclic Word Graph (CDAWG) directly from the text in strict O(n) deterministic time and O(n) space over an integer alphabet, without first building the full Suffix Tree or Suffix Automaton as an intermediate step." I noted that classical CDAWG construction (Crochemore, Blumer et al.) constructs the entire Suffix Automaton (with up to 2n states and 3n transitions) or Ukkonen's Suffix Tree, and then compresses degree-1 paths, which wastes a factor of 10 in memory on massive genomic sequences. I proposed using Inenaga-Hoshino-Shinohara-Takeda's Direct On-Line CDAWG Construction Algorithm. The interviewer challenged me: "In a CDAWG, an edge can represent a substring of length > 1, meaning implicit states can exist along edges; walk me through how Ukkonen's active point concept is generalized to track an implicit location (s, (k, p)) in the CDAWG, and how edge splitting preserves the minimality of both left and right equivalence classes during character appends." I explained that a state in the CDAWG represents an equivalence class of substrings having identical sets of right contexts (end-positions) AND identical left contexts. The direct online algorithm maintains an active point represented by a tuple (v, \gamma) where v is an explicit CDAWG node and \gamma is a substring pointing to an implicit position on an outgoing edge of v. When appending character c: (1) We test whether the active point has an outgoing transition for c. If it does, we advance the active point along that edge and continue. (2) If no transition exists, an edge split occurs: the implicit state at the active point is reified into a new explicit node w, splitting the edge into two edges. (3) To preserve the CDAWG invariant, we must verify whether state w has a unique left-extension (meaning its left-context is maximal). If extending w by preceding characters branches into different contexts, w is a canonical node; otherwise, w must be merged with an existing ancestor state via suffix links. We update the suffix link of the newly created node by traversing suffix paths using suffix links of explicit nodes, exactly as in Ukkonen's algorithm, but skipping over compressed edge chains in O(1) amortized steps using the jump pointers. Because each node creation and edge split decreases the total string length remaining on the active edge, the sum of all edge traversals and node splits across all n characters is bounded by O(n). This constructs the minimal CDAWG directly in strict O(n) deterministic time using only 2r states (where r is the number of BWT runs) and O(n) working space.

Posted on - 27 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.