Salesforce HackerRank OA (2022) | Bit Manipulation (XOR) | Off-campus

Salesforce · Question · Posted Jun 2026

Question 1: Sum of XOR of pairs Problem Statement You are given an array of integers. Find the sum of XOR of all pairs formed by the elements of the array. (Note: A pair can be formed by any two elements including itself, and (A[i], A[j]) is considered distinct from (A[j], A[i])). Input Format The first line of input contains T - the number of test cases. It's followed by 2*T lines, the first line contains N - the size ...

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

Log in Create a free account