The asked me about node.js experience, then what sort of testing I used. Basic react questions. What is a callback function? What is a promise? What are the three steps of a promise? What are hooks and how do you use them?
What is the output of the following lines of code? console.log('Step1'), setTimeout(() => console.log('Step2'), 0); Promise.resolve('Step3').then((res) => console.log(res)); console.log('Step4');
You are given a string S consisting of N letters 'a' and/or 'b'. In one move, you can swap one letter for the other ('a' for 'b' or 'b' for 'a'). Write a function solution that, given such a string S, returns the minimum number of moves required to obtain a string containing no instances of three identical consecutive letters.