Tredence interview question

1. Given two variables swap it's value with using any third variable by thinking mathematically 2.Given a function which can take Integer 0 and 1, without using any logical and conditional operator return the inputs opposite. 3. SetTimeOut Behaviour inside For Loop 4. An array with some elements, given the length property value made to zero which will be the console output on arr[0] And one or two more stupid questions like this

Interview Answer

Anonymous

19 Dec 2023

1. I swapped the variables mathematically by adding up b with a and deducted respectively to reassign and swap. 2. I couldn't think the second question as mentioned, in the given 1min time in the clustered atmosphere and vibes I was getting in the interview