FastPrepIdentify Two Failing Tests From an Oracle Transcript
Problems/Identify Two Failing Tests From an Oracle Transcript

Identify Two Failing Tests From an Oracle Transcript

PhonePe logoPhonePe● MediumFULLTIMEONSITE INTERVIEW
QuestionFunctionExamplesConstraints

Problem statement

Source note: The reported task identifies this algorithmic exercise. The executable interface, bounds, deterministic tie rules, and examples are the documented practice contract.

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 = 2queries = [[0,1]]failedResponses = [true]return = [0,1]

Case 1 exercises the documented deterministic contract.

Example 2

testCount = 3queries = [[0,1],[0,2],[1,2]]failedResponses = [false,true,false]return = [0,2]

Case 2 exercises the documented deterministic contract.

Example 3

testCount = 4queries = [[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.

More PhonePe problems

  • Evaluate DivisionONSITE INTERVIEW · Seen Oct 2026
  • K-th Smallest Value in a Sorted MatrixONSITE INTERVIEW · Seen Oct 2026
  • Constrained Jump SequencesOA · Seen Aug 2026
All PhonePe interview questionsSee PhonePe hiring insights
Saved
class Solution {
    public int[] identifyFailingTests(int testCount, int[][] queries, boolean[] failedResponses) {
        // Write your code here.
    }

}
Checking account…