Last active
May 8, 2024 16:14
-
-
Save CaptainOfFlyingDutchman/79f1c99de64d8c27fcc900c12ae2d622 to your computer and use it in GitHub Desktop.
Revisions
-
CaptainOfFlyingDutchman revised this gist
May 8, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ --- #### Q.When do `useMemo` and `useEffect` run in a component life cycle? ###### A. `useMemo` runs before a component renders while `useEffect` runs after component has rendered and is mounted in the browser DOM. --- #### Q. Would you choose React `Context` to store the application data or a state manager? -
CaptainOfFlyingDutchman renamed this gist
May 8, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
CaptainOfFlyingDutchman revised this gist
May 8, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ --- #### Q. Is `Promise` constructor `async` like `setTimeout` or `sync`? ###### A. It is `sync`. --- #### Q. What is the difference between `Function.call` and `Function.bind`? -
CaptainOfFlyingDutchman renamed this gist
May 8, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
CaptainOfFlyingDutchman created this gist
May 8, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ ### Frontend Screening Interview Questions --- #### Q. How do you check if a variable holds an array? ###### A. Using `Array.isArray` function. --- #### Q. How would you generate a long string of a single character? ###### A. Using `String.repeat` function. Example, `'M'.repeat(255);` will generate 255 `M` characters in a single string --- #### Q. Is `Promise` constructor `async` like `setTimeout` or `sync`? ###### A. It is `async`. --- #### Q. What is the difference between `Function.call` and `Function.bind`? ###### A. `Function.bind` returns a new function with bounded arguments, while `Function.call` just calls the function with the given arguments. --- #### Q. What is the difference between `Function.reduce` and `Function.map`? ###### A. `Function.reduce` acts like a collection aggregator while `Function.map` just returns a new array probably after performing some calculation on the original array's elements. --- #### Q. When would you opt for using `Map` instead of a simple `object`? ###### A. If we have constantly changing object then we would use `Map` for its high performance, while for static objects a simple `object` would work. --- #### Q.When do `useMemo` and `useEffect` run in a component life cycle? ###### A. `useMemo` runs on before a component renders while `useEffect` runs after component has rendered and is mounted in the browser DOM. --- #### Q. Would you choose React `Context` to store the application data or a state manager? ###### A. Use a state manager always, `Context` is used only for light weighted information sharing. --- #### Q. What are the advantages of `CSS-in-JS` and `CSS Modules` over the standard CSS in React? ###### A. These solutions scope the CSS thus a developer is free to use same CSS rule name across the project without having a name collision and rules overriding.