SDE
Interview Date
17-08-2026
Result
Rejected
Difficulty
Hard
Rounds
01
Drive Type
Off-Campus
Topics asked
Detailed experience
The interviewer opened with an advanced algebraic graph theory and lattice routing challenge: "Given an undirected simple graph G with n vertices and m edges, determine whether G contains an induced cycle of length at least 4 (a chordless cycle or 'hole') in O(n^9) or faster, and optimize it to O(n^alpha) or O(n^2 * m) to detect an odd hole—proving whether G is a Perfect Graph via the Strong Perfect Graph Theorem." I noted that searching for an induced path between non-adjacent endpoints naively requires testing all induced configurations, which easily runs in exponential time because subpaths can develop shortcut chords. I proposed Chudnovsky, Robertson, Seymour, and Thomas's Polynomial-Time Odd Hole Recognition Algorithm (or the Nikolopoulos-Palios Chordless Cycle Detector). The interviewer followed up: "What structural obstacle prevents a standard BFS from detecting odd chordless cycles, and how does the concept of a 'clean' shortest induced path allow finding a shortest hole via tripartite node expansions?" I explained that in standard BFS, paths can cross or contain chords, destroying the chordless property; if you forbid adjacent vertices, you destroy the optimal substructure needed for dynamic programming. The breakthrough of Chudnovsky et al. relies on the fact that in a shortest odd hole C, there exists a vertex v and an edge (u, w) opposite to v such that no vertex of C (except v's neighbors) has a chord to v. We can guess this five-tuple of key vertices (the "center" v, two flanking neighbors, and the opposite edge endpoints) by iterating over O(n^5) configurations. Once fixed, all potential vertices in G that could create unwanted chords to v or the opposite edge are pruned from the graph. In this "cleaned" graph, the shortest induced path between the designated endpoints is guaranteed to have no shortcutting chords. Running BFS on an auxiliary graph where states represent non-adjacent edges (to enforce the chordless condition locally) constructs the path in O(n^2) time per guess, dropping the total detection runtime to O(n^7) (and with advanced cleaning, to O(n^4)), certifying whether G has an odd hole in polynomial time. He then shifted to a computational geometry and kinetic ray-tracing scenario in 3D: "Given n non-intersecting polyhedral obstacles in 3D space with a total of V vertices, preprocess the scene to answer continuous Ray-Shooting queries—given a ray origin p and direction d, find the first obstacle face hit by the ray—in O(log^2 V) query time, using near-linear space." I pointed out that standard bounding volume hierarchies (BVH) or Octrees suffer from worst-case O(V) query times for pathological ray configurations, while exact 3D ray-shooting via Plücker coordinate hyperplane arrangements takes O(V^4) space, which is impossible when V = 10^5. I proposed reducing 3D ray-shooting to a sequence of 2D Parametric Visibility Searches over Cylindrical Algebraic Decompositions paired with Segment Trees of Upper Envelopes. The interviewer cut in: "Walk me through how Plücker coordinates represent directed 3D lines as points in 5D projective space P^5 on the Klein Quadric, and how intersecting a line with a polygon edge translates to an orientation predicate." I explained that a directed 3D line passing through points p and q is mapped to a 6-tuple of Plücker coordinates L = (q - p, p x q) = (d, m) in R^6, which satisfies the quadratic Grassmann-Plücker relation d · m = 0, defining the 4D Klein Quadric hypersurface in P^5. For a ray L and a directed 3D segment e, the ray passes to the left or right of e depending on the sign of the reciprocal product: Plücker(L) * Plücker(e) = d_L · m_e + d_e · m_L. A ray penetrates a triangular obstacle face if and only if it has a consistent orientation (all positive or all negative reciprocal products) with all three directed bounding edges of the triangle. By lifting triangle boundaries to hyperplanes in P^5, testing whether a ray strikes a face becomes a point-hyperplane half-space query. Combining a multi-level 5D Partition Tree (Matoušek's geometric cuttings) with parametric search over ray depth t allows us to home in on the first surface intersection in O(V^(1 - 1/4 + epsilon)) or polylogarithmic time across smooth scenes using O(V log V) space. For the final challenge, he introduced an algebraic string algorithm and compressed pattern topology: "Given a 2D digital image represented as a Quadtree of depth k containing at most n leaves (where the uncompressed grid has size 2^k x 2^k and 2^k can be up to 10^9), and a raw pattern matrix P of size m x m, count the exact occurrences of P in the image in polynomial time parameterized strictly by n and m, without expanding the 2^k x 2^k pixel grid." I pointed out that decompressing a quadtree of depth 30 takes 2^60 pixels, which runs out of memory instantly. I proposed reducing the Quadtree to a 2D Grammar-Compressed String and using Bottom-Up DAG Contraction with Boundary Morphisms. The interviewer challenged me: "A quadtree has 4 child pointers per node (NW, NE, SW, SE); how do you collapse identical quadtree subtrees into a minimal Directed Acyclic Graph (DAG), and how are pattern occurrences across internal quadrant boundaries computed?" I broke down the algebraic pipeline: first, we compute canonical hashes for all quadtree nodes from bottom to top and merge isomorphic subtrees into a minimal Quadtree DAG (the 2D equivalent of a Straight-Line Program) containing at most n nodes. Second, for each DAG node u representing a block of size 2^h x 2^h, an occurrence of the m x m pattern P either fits entirely inside one of its 4 children (NW, NE, SW, SE), or it overlaps the internal vertical/horizontal cross-dividers separating the quadrants. To capture boundary matches without expanding blocks, each node u maintains an m-bounded "collar" (the outer strip of width min(m - 1, 2^h) along its 4 perimeters and the center cross of width 2m). For each node u in bottom-up topological order, we compute its internal matches by taking the sum of matches in its 4 children plus the matches crossing the horizontal/vertical quadrant borders inside its collar. Border matches are evaluated by sliding the m x m pattern P across the 2m x 2m central cross using 2D FFT or 2D rolling hashes in O(m^2) time per node. We store the match count memoized in the DAG node. Because identical blocks share the exact same DAG node, each node is processed once, solving the 2D pattern count over the 10^18 grid in strict O(n * m^2) time and O(n * m) space.