Goldman Sachs 2025-March | HashMap & Bit-Masking Optimization | On-campus

GoldmanSachs · Question · Posted Jun 2026

Question 1: Count Equal Pairs Problem Statement You are given 2 arrays A and B of the same size N. A pair (i, j) is said to be valid if and only if: i < j, A[i] == B[j] and A[j] == B[i]. You have to count the total number of valid pairs. Input Format First line of input contains T - number of test cases. First line of each test case contains N - size of the array. The ...

The full answer & interview discussion are available to premium members.

Log in Create a free account