Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CaptainOfFlyingDutchman/79f1c99de64d8c27fcc900c12ae2d622 to your computer and use it in GitHub Desktop.
Save CaptainOfFlyingDutchman/79f1c99de64d8c27fcc900c12ae2d622 to your computer and use it in GitHub Desktop.

Revisions

  1. CaptainOfFlyingDutchman revised this gist May 8, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion josys-frontend-interview-screening-questions.md
    Original 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 on before a component renders while `useEffect` runs after component has rendered and is mounted in the browser DOM.
    ###### 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?
  2. CaptainOfFlyingDutchman renamed this gist May 8, 2024. 1 changed file with 0 additions and 0 deletions.
  3. CaptainOfFlyingDutchman revised this gist May 8, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion josys-frontend-interview-screeing-questions.md
    Original 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 `async`.
    ###### A. It is `sync`.

    ---
    #### Q. What is the difference between `Function.call` and `Function.bind`?
  4. CaptainOfFlyingDutchman renamed this gist May 8, 2024. 1 changed file with 0 additions and 0 deletions.
  5. CaptainOfFlyingDutchman created this gist May 8, 2024.
    37 changes: 37 additions & 0 deletions josys-frontend-interview-screeing-questions
    Original 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.