Facebook FrontEnd Interview Questions

Searched on the internet, and here is a memo, so that anyone could do interview preparation based onti.

  1. run time for search algorithms

  2. prototype inheritance

  3. 'this'

  4. closure

  5. var vs const vs let

  6. DOM tree

  7. graph algorithm

  8. system design -> edge case, performance issues,

  9. behavorial -> "10 STAR questions to answer"

  10. map, forEach, apply, call,

  11. Array vs Object

  12. Flatten Array, Create Emitter

  13. Observable

  14. optimize a function

  15. Explain the concept of ES6 Promises to a 5-year-old

  16. What are the advantages of using ES6 maps over objects? What about using ES6 sets over arrays?

  17. studying JS's built in data structures and their associated functions (i.e. map, forEach, reduce for an array).

  18. Given input:
    // could be potentially more than 3 keys in the object above
    items = [
    {color: 'red', type: 'tv', age: 18},
    {color: 'silver', type: 'phone', age: 20}
    ...
    ]
    excludes = [
    {k: 'color', v: 'silver'},
    {k: 'type', v: 'tv'},
    ....
    ]
    function excludeItems(items, excludes) {
    excludes.forEach(pair => {
        items = items.filter(item => item[pair.k] === item[pair.v]);
    });
    return items;
    }
    1. Describe what this function is doing...
    2. What is wrong with that function ?
    3. How would you optimize it ?  
  19. Why Facebook? Why Front End? Tell about a project you had and how you solved it? Tell about a conflict you had at work and how you dealt with it?

  20. Given two identical DOM tree structures, A and B, and a node from A, find the corresponding node in B.

  21. Given a picture, how would you hide/show a child picture on hovering on this parent?

  22. How would you ensure clicking on this picture would go to a specific link?

  23. How would you ensure the child is positioned in the top right of the parent picture?

  24. Given an array, return it's flattened structure(skip objects)

  25. If you have 500 revisions of a program, write a program that will find and return the FIRST bad revision given a isBad(revision i) function.

  26. difference between == and ===

  27. difference between block and inline

  28. Given a grid of characters output a decoded message. The message for the following would be     IROCKA. (diagonally down right and diagonally up right if you can't go further .. you continue doing        this)
    
    I B C A L K A
    D R F C A E A
    G H O E L A D  
  29. just know your positioning, relative, static etc know the differences inside out

  30. If you were building a search tool and wanted search results to pop up as you typed but the server call was taxing, write a function that gets called on every key down but calls the server when the user stops typing for 400ms.

以上では各投稿者の観点であり、zanp.lifeに責任負い兼ねます。

#js#typescript#react#hooks

jser  2020-4-26