Vidio interview question

Test case example: assertEqual(true, obj.isEmpty()) -> what to modify in obj's class for the test to be correct.

Interview Answer

Anonymous

14 Jul 2022

Make a number=0 var in the class, then add isEmpty() function that returns true if number=0 and false otherwise. Then add add() function that incrementally adds the number var, etc.