Cars
Yesterday
958
Do you really feel special in your Tesla?
India
Yesterday
1253
Modi is a legend, will be remembered for centuries to come
Tech Industry
8h
960
Women, help me understand why this is inspirational
Tech Industry
59m
1148
What happens when most of your team is Indian?
Software Engineering Career
Yesterday
1608
Offers after multiple months of prep
Title
Practice using the debugger and unit testing on your chosen programming language. During the interview, run the unit tests and find the ones that fail. On the one that fails, understand the parts of the test that work and then step through the part that fails. Once you find that part, see how you can fix it. Try to fix it and re run the tests. Repeat that until the tests are fixed. Basically the same way you would in a real life scenario. Speak out loud about what you see and why you think a certain fix might work.
Thanks for such a comprehensive response. Should we run the whole test suite? Or we need to drill down to the test which is relevant to the bug. Also do they tell you how many bugs are there?
I opened the project in IntelliJ and ran all the tests. Two of them failed if I remember correctly... so I took one and then looked at the code inside of it. I stepped through it and found that 2 assertions were failing. I then started looking into the assertions that were not failing to understand what the code was actually doing. Then I looked into the code that was failing to see if I could find the bug. I did and I fixed it. Then I ran the tests again, and repeated. After a few times I got all tests to pass. Don't forget to talk through the process of how you get there.