Contribute OA questions
OAHelper
CompaniesProblemsTopicsInterview Experiences
Explore
M

Microsoft

SDE

Interview Date

14-08-2026

Result

Rejected

Difficulty

Medium

Rounds

01

Drive Type

Off-Campus

Interview Date

14-08-2026

Result

Rejected

Difficulty

Medium

Rounds

01

Drive Type

Off-Campus

Topics asked

DSA

Detailed experience

The interviewer opened with an advanced linear algebra state-space problem: "Given an undirected simple graph G with n vertices, compute the maximum size of a general matching (not necessarily bipartite) in polynomial time using randomized linear algebra." I noted that Edmond's Blossom algorithm finds a maximum matching deterministically in O(V^2 * E) or O(V^3) time, but can be cumbersome to implement under tight interview limits. I proposed reducing the problem to finding the matrix rank of the Tutte Matrix over a finite field via the Tutte-Berge Formula and the Lovasz / Rabin-Vazirani Theorem. The interviewer followed up: "Walk me through how the skew-symmetric Tutte matrix is constructed, and why the Schwartz-Zippel lemma guarantees correctness." I explained that for an undirected graph, we construct an n x n symbolic matrix T where T[i][j] = x_{i,j} if (i, j) is an edge and i < j, T[i][j] = -x_{j,i} if i > j, and T[i][i] = 0. Tutte proved that the determinant det(T) is non-zero as a polynomial if and only if G has a perfect matching, and more generally, the matrix rank rank(T) over R equals exactly 2 * (maximum matching size). To compute this numerically without symbolic expansion, we replace each variable x_{i,j} with an independent uniform random integer chosen from a finite field Z_p where prime p is large (e.g., 10^9 + 7). By the Schwartz-Zippel Lemma, evaluating the polynomial at random points preserves non-zero evaluations with probability at least 1 - deg(det(T)) / p >= 1 - n / p, making false rank collapses vanishingly rare. We then run Gaussian Elimination over Z_p in O(n^3) time; dividing the resulting pivot rank by 2 yields the maximum matching size in strict O(n^3) time and O(n^2) space. He then shifted to string factorization and lexicographic analysis: "Given a string s of length n, compute its unique Lyndon Factorization—decomposing s into substrings w_1 w_2 ... w_k such that each w_i is a Lyndon word (strictly smaller than all its non-trivial cyclic shifts) and w_1 >= w_2 >= ... >= w_k lexicographically—in strict linear time and O(1) auxiliary space." I noted that generating all suffixes or factoring via Suffix Automata takes O(n) space and larger constant factors. I proposed Duval's Algorithm. The interviewer cut in: "Duval operates by maintaining a three-pointer invariant—walk me through how the pointers track pre-Lyndon words and handle periodic repetitions." I broke down the invariant: the string is partitioned into three parts: already factored prefix s[0...i-1], an active pre-Lyndon word s[i...k-1] of the form w^p v (where w is a Lyndon word and v is a proper prefix of w), and the unexamined suffix s[k...n-1]. We maintain pointers i (start of active component), j (start of period comparison), and k (current scan position). At each step, we compare s[k] with s[j]: if s[k] == s[j], the periodic repetition continues, so we advance j and k; if s[k] > s[j], appending s[k] breaks the periodicity and creates a longer Lyndon word, so we reset j = i and advance k; if s[k] < s[j], the Lyndon property breaks. In this third case, s[i...k-1] cannot be extended further; we output w repeated p times by advancing i by period length k - j repeatedly until i catches up to the un-factored boundary, resetting j and k to i. Because each character is read at most twice, Duval factors the string in strict O(n) time and O(1) auxiliary space. For the final challenge, he introduced an algebraic set-intersection and convolution problem: "You are given two arrays A and B of length 2^n representing boolean characteristic vectors of subsets of an n-element universe; compute the fast Walsh-Hadamard Transform (FWHT) to evaluate their bitwise-AND convolution C[k] = sum_{i AND j = k} (A[i] * B[j]) in O(n * 2^n) time." I pointed out that evaluating all pairs takes O((2^n)^2) = O(4^n) time, which fails when n = 20. I proposed applying the Fast Walsh-Hadamard Transform (FWHT) or Fast Subset / Zeta Transform. The interviewer challenged me: "Walk me through how the transform matrix for the bitwise-AND operation differs from standard XOR (Hadamard) convolution, and show the divide-and-conquer butterfly step." I explained that just as NTT/FFT diagonalizes circular convolutions, FWHT diagonalizes bitwise convolutions. For bitwise-AND, an element k is a sub-mask of both i and j; the forward transform is equivalent to computing superset sums (the Zeta transform over the Boolean lattice): FWHT(A)[mask] = sum_{mask is submask of s} A[s]. The base 2x2 butterfly matrix for bitwise-AND is [[1, 1], [0, 1]], where for every pair of states (u, v) representing the absence and presence of the current bit, the forward transform sets u = u + v while keeping v unchanged. After transforming both arrays A and B in O(n * 2^n) via Cooley-Tukey butterfly passes across all n bit positions, the convolution in the transform domain is simply pointwise multiplication: FWHT(C)[i] = FWHT(A)[i] * FWHT(B)[i]. We then apply the inverse transform using the inverse butterfly matrix [[1, -1], [0, 1]] (setting u = u - v) in O(n * 2^n) to reconstruct the exact array C. He verified the inverse butterfly subtraction, confirming the O(n * 2^n) time and in-place O(1) extra space bounds.

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.