Frequently asked Frontend programming interview questions
3 min readJun 26, 2022
1. Count the occurrence of characters in given string
2. Shift all 0s to the right
3. Create a Singleton instance from functions
4. Pollyfill of bind
5. Pollyfill of Promise.all()
6. Flat a given array with and without level control
7. Infinite Currying
8. Find nth Largest and Smallest number
Although, interviewer was not happy with this solution, he was looking a solution without sorting.At that time I can only think of a solution using for loop.Do let me know if you have any better solution for this.
9. Check if String is palindrome
Note: This will not work in case of string have spaces.
10. Fibonacci series with Memoization
console.time();
console.log(res(22));
console.timeEnd(); // 1.408203125 msconsole.time();
console.log(res(22));
console.timeEnd(); // 0.015869140625 ms