Microsoft OA Questions & Chances
Anonymous User
1085
Jun 27, 2026
Jun 27, 2026
Hi people I had a OA from Microsoft Last day for SDE 2 L62
2 DSA questions one medium and one hard
in Medium problem my test case ran 15/15, and for Hard problem 12/15.
can anyone tell me what are my chances to get a call back.
Intermidiet Problem :
A new circuit has been designed that takes three inputs: A, B, and N. The task is to find an integer X such that X < 2^N and the product of (A ⊕ X) and (B ⊕ X) is maximized. The result should be returned modulo (10^9 + 7). Note that ⊕ represents the bitwise XOR operator.
Example:
A = 4
B = 6
N = 3
We can choose X = 3: (A ⊕ X) = 7 and (B ⊕ X) = 5. The product is 35 and 35 modulo (10^9 + 7) = 35.
Function Description: Complete the function xorMultiplication with the following parameters: A: an integer, B: an integer, N: an integer.
Returns: An integer representing the maximum product modulo (10^9 + 7).
Constraints: 0 ≤ N ≤ 30
1 ≤ A < 2^N
1 ≤ B < 2^N>
Hard problem :
A neural network has n neurons numbered from 1 to n. If the ith neuron has strong connectivity, strongConnectivity[i] = 1. If it has weak connectivity, strongConnectivity[i] = 0.
The neurons form a tree-like network with n-1 connections, where the ith connection connects neurons neuronFrom[i] and neuronTo[i]. A neuron's strength is defined as the maximum difference between strongly connected and weakly connected neurons in any subnetwork including that neuron.
Return an array of n integers, where the ith integer represents the strength of neuron i.
Note: A subnetwork is a connected subgraph of the given network.
Example
n = 4
neuronFrom = [1, 1, 1]
neuronTo = [2, 3, 4]
strongConnectivity = [0, 0, 1, 0]
Neuron 3 has strong connectivity.
For neuron 1's strength, consider the subnetwork with neurons 1 and 3: 1 strong, 1 weak → strength = 0
For neuron 2's strength, consider the subnetwork with neurons 1, 2, and 3: 1 strong, 2 weak → strength = -1
For neuron 3's strength, consider the subnetwork with only neuron 3: 1 strong, 0 weak → strength = 1
For neuron 4's strength, consider the subnetwork with only neuron 4: 0 strong, 1 weak → strength = -1
The neuronStrengths array is [0, -1, 1, -1].Comments (4)


