Reported September 2026
PhonePearray

Identify Two Failing Tests From an Oracle Transcript

Reported by candidates from PhonePe's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live PhonePe OA. Under 2s to a working solution.
Founder's read

PhonePe reported this one in September 2026, and the title makes it sound like a debugging story. It isn't. It's a constraint-elimination problem dressed up as an oracle transcript. You've got testCount IDs, exactly two are failing, and each query tells you whether both failing IDs sit inside that subset. If you're taking this OA in the next day or two, the real task is filtering candidate pairs against every query until one survives. StealthCoder is there as a safety net if you blank mid-assessment, but the logic below is short enough to carry in your head.

The problem

Exactly two test IDs from 0 through testCount - 1 are failing. A captured oracle query returns failure exactly when both failing IDs are included in that query.
Given the queried ID subsets and their boolean failure responses, return the unique failing pair in increasing order. The transcript is guaranteed to identify exactly one pair.

Function
identifyFailingTests(testCount: int, queries: int[][], failedResponses: boolean[]) → int[]

Examples
Example 1
testCount = 2
queries = [[0,1]]
failedResponses = [true]
return = [0,1]
Case 1 exercises the documented deterministic contract.
Example 2
testCount = 3
queries = [[0,1],[0,2],[1,2]]
failedResponses = [false,true,false]
return = [0,2]
Case 2 exercises the documented deterministic contract.
Example 3
testCount = 4
queries = [[0,1],[0,2],[0,3],[1,2],[1,3],[2,3]]
failedResponses = [false,false,false,false,true,false]
return = [1,3]
Case 3 exercises the documented deterministic contract.

Constraints
2 <= testCount <= 100.
1 <= queries.length == failedResponses.length <= 5000.
Each query contains unique valid IDs.

Reported by candidates. Source: FastPrep

Pattern and pitfall

Here's what it reduces to. With testCount at most 100, there are at most 4950 candidate pairs. A query returns true only when both failing IDs are in it. So a true response means the pair must be a subset of that query. A false response means the pair must NOT be fully contained in it. Start with all pairs (i,j), and for each query build a membership set or boolean array, then check each pair against it. Keep a pair only if its containment matches the response. Exactly one pair survives, return it sorted. Cost is pairs times queries, about 4950 times 5000 checks with O(1) membership, which is fine. The common pitfall is treating a false response as meaning neither ID is failing. It only means at least one is missing from the query. Also don't forget to return the pair in increasing order.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Identify Two Failing Tests From an Oracle Transcript cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass PhonePe's OA.

PhonePe reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Identify Two Failing Tests From an Oracle Transcript FAQ

What's the trick in the PhonePe failing tests problem?+

Brute-force elimination. Enumerate every pair (i,j) with i<j and test it against each query. A pair is consistent if both IDs are in the query exactly when the response is true. Only one pair survives all queries, and that's your answer.

Is brute force fast enough here?+

Yes. testCount is at most 100, so there are under 5000 pairs, and queries are at most 5000. That's roughly 25 million containment checks, fine if each query is stored as a boolean array or set for O(1) lookup.

What does a false response actually tell me?+

Only that the two failing IDs are not both inside that query. One could be inside. People wrongly eliminate every ID in a false query, which breaks Example 2, where [0,1] is false yet 0 is failing.

Can I prune faster than checking every pair?+

Yes. Every true query shrinks candidates to pairs inside it, so intersect the true queries first to get a small ID set. Then test pairs from that set against the false queries. It's optional, since brute force already fits the constraints.

How do I prepare for this in 48 hours?+

Practice turning a transcript of constraints into a filter loop. Write the pair enumeration, a per-query membership array, and the consistency check from scratch. Run it on the three examples, including testCount = 4 returning [1,3]. It's about twenty lines once you see it.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with PhonePe.

OA at PhonePe?
Invisible during screen share
Get it