SDE
Interview Date
17-08-2026
Result
Rejected
Difficulty
Medium
Rounds
01
Drive Type
Off-Campus
Topics asked
Detailed experience
The interviewer opened with an advanced algebraic graph theory and lattice topology challenge: "Given an undirected simple graph G with n vertices and m edges, compute the exact size of its Bicycle Space (the intersection of the cycle space and the cut space over GF(2)), and determine whether G admits an Eulerian orientation in polynomial time via the Nullity of the Adjacency-Laplacian Sum." I noted that the cycle space Z(G) has dimension m - n + c and the cut space B(G) has dimension n - c, but their intersection B_y(G) = Z(G) \cap B(G) captures self-dual topological flows that are simultaneously orthogonal to all cuts and all cycles over GF(2). I proposed computing the dimension using the binary incidence matrix B over F_2. The interviewer followed up: "Walk me through how the bicycle space relates to the kernel of the Laplacian matrix L = B * B^T over GF(2), and explain how a non-trivial bicycle vector certifies a self-dual planar graph orientation." I explained that over the field F_2 = {0, 1}, an edge subset x is a cycle if and only if B * x = 0 (every vertex has even incident degree in x), and x is a cut if and only if x = B^T * y for some vertex subset y. An edge subset x belongs to the bicycle space if both conditions hold: x = B^T * y and B * x = 0. Substituting the second into the first yields B * B^T * y = 0 over F_2. The matrix L_2 = B * B^T (mod 2) is the binary Laplacian matrix of G, where L_2[i][i] = deg(v_i) mod 2 and L_2[i][j] = A[i][j] mod 2 for i != j. Therefore, the dimension of the bicycle space is exactly the nullity of L_2 over F_2 minus the number of connected components. By Shanks's Bicycle Theorem, this dimension equals the nullity of the adjacency matrix of the planar dual if G is planar. We form the binary Laplacian in O(n + m) time and compute its rank via Gaussian elimination over F_2 using bitset operations in O(n^3 / 64) time. If the bicycle space has dimension 0, the cycle and cut spaces are orthogonal complements that decompose the entire edge space direct-sum style: E(G) = Z(G) \oplus B(G), certifying that every cycle can be uniquely decomposed into planar face boundaries. He then shifted to a computational geometry and kinetic dynamic partition problem: "Given n discs in the 2D plane, find a Minimum Enclosing Circle (1-Center) in optimal O(n) expected time using Welzl's algorithm, and generalize it to an online data structure that maintains the minimum enclosing ball of moving points under linear trajectories p_i(t) = a_i + v_i * t in O(1) combinatorial update time per topological event." I pointed out that the static problem is solvable in O(n) expected time via randomized LP-type frameworks, but continuous trajectories cause the 2-point or 3-point support set defining the minimum enclosing ball to switch dynamically over time. I proposed maintaining a Kinetic Minimum Enclosing Ball (KMEB) using a Kinetic Event Queue over circumradius polynomial roots. The interviewer cut in: "A minimum enclosing circle is uniquely defined by either 2 antipodal boundary points or 3 boundary points forming an acute triangle; write down the algebraic condition that causes a 2-point basis to fail or switch to a 3-point basis, and bound the polynomial degree of the event function." I explained that let B(t) be the current active support basis. If |B(t)| = 2 with points p_i(t) and p_j(t), the center is c(t) = (p_i(t) + p_j(t)) / 2 and the squared radius is R^2(t) = ||p_i(t) - p_j(t)||^2 / 4. This basis fails if an external point p_k(t) breaches the boundary, meaning ||p_k(t) - c(t)||^2 > R^2(t). Substituting linear motions p_m(t) = a_m + v_m * t makes both c(t) and R(t) rational functions or low-degree polynomials: the clearance function f_k(t) = ||p_k(t) - (p_i(t) + p_j(t))/2||^2 - ||p_i(t) - p_j(t)||^2 / 4 is a quadratic polynomial in t. If |B(t)| = 3 with points p_i, p_j, p_k, the circumcenter coordinates are rational functions whose numerator and denominator have degree 2 in t. A 3-point basis fails either when an external point enters the circumcircle (a certificate root of the 4x4 parabolic lifting determinant, which has degree at most 4 in t), or when the triangle ceases to be acute and the center exits across an edge (meaning an angle reaches 90 degrees: (p_j(t) - p_i(t)) · (p_k(t) - p_i(t)) = 0, a quadratic equation in t). We schedule all future real positive roots of these quadratic and quartic certificates in a global priority queue. When an event fires, the basis transitions in O(1) time: either an external point is added to the basis or an obtuse point is dropped, restoring the LP-type basis with O(log n) queue updates per event. For the final challenge, he introduced an algebraic string structure and run-length periodicity scenario: "Given an arbitrary string s of length n, find all maximal subsegments that are Border-Free (contain no proper prefix that is also a suffix of the subsegment) and construct the Shortest Border Array (the length of the shortest non-empty border for every prefix of s) in strict O(n) deterministic time." I noted that the standard KMP failure function pi[i] computes the *longest* border for each prefix. Querying pi repeatedly along suffix links to find the shortest border takes O(n^2) worst case (e.g., for string "aaaa...a"). I proposed maintaining the Shortest Border Array via Path Compression and Suffix-Link Skip Jumps (the Duval-Crochemore Periodicity Collapse). The interviewer challenged me: "Walk me through why the shortest non-empty border cannot be computed by simple bottom-up memoization on the KMP tree, and show how jumping along periodic chains ensures O(1) amortized steps per character." I explained that let sb[i] denote the length of the shortest non-empty border of prefix s[0...i]. If prefix s[0...i] has no border, sb[i] = 0. If s[0...i] has borders, let its longest border be L = pi[i]. By border periodicity (the Weak Periodicity Lemma), all borders of s[0...i] are borders of s[0...L-1]. If sb[L - 1] > 0, then the shortest border of s[0...i] is simply sb[L - 1], because the shortest border of a border is itself a valid border of the parent string. The single edge case is when L > 0 but sb[L - 1] == 0; this occurs if and only if L itself has no proper borders, meaning L is the shortest border of s[0...i], so sb[i] = L. Therefore, sb[i] satisfies the direct relation: if pi[i] == 0, then sb[i] = 0; else if sb[pi[i] - 1] != 0, then sb[i] = sb[pi[i] - 1]; else sb[i] = pi[i]. Because this requires only looking up the precomputed value of sb at index pi[i] - 1, each entry sb[i] is evaluated in strict O(1) worst-case time once the standard KMP array pi is known. Computing the KMP array takes O(n) deterministic time and O(n) space, allowing the entire Shortest Border Array and all border-free subsegment boundaries to be constructed in strict O(n) time and O(n) space without tree traversals.