Questions obtaining values for next query by performing XOR operation

I have seen many problems (involving queries) in which we are given numbers for each query and we need to perform XOR of the given numbers with the result of previous query to obtain the real values to perform next query.

For example in DEC18A, we have CBFEAST question having the lines "The value of c for this query is computed as c=CāŠ• ans, where ans is the answer to the previous query"

Similarly, I seem many problems like.

Why this is done?
Why we are not given the original numbers simply?
Or do they involve some trick in solving?

1 Like

This means that the problem expects online algorithm as a solution. It is opposite to offline algorithm, where the whole set of input queries is given.

1 Like

Thanks !!! missed that part.