Frontend
Расскажи про критические этапы рендеринга браузера
Парсинг HTML и CSS происходит последовательно или параллельно?
Параметры в функцию передаются по ссылке или по значению?
Расскажи про event loop: для чего нужен, как работает
Расскажи про call stack: как работает, в какой последовательности выполняются задачи
Что такое псевдомассив arguments? Чем отличается от обычного массива?
Что такое чистая функция? Когда функция является чистой? Что такое побочные эффекты?
Что такое рекурсия? Какие у неё правила? Для чего нужна?
Emotion и styled-components генерируют стили в runtime — это проблема? Когда начинает болеть? Какие есть альтернативы с лучшим performance?
Зачем нужен React? Какие проблемы решает? Когда он избыточен?
Что такое React Reconciliation? Как работает? По каким критериям React решает обновить или перемонтировать компонент?
Что изменилось в React 18 в процессе Reconciliation?
В какой момент вызывается useEffect и useLayoutEffect?
Что делает useMemo? Когда его использовать? Нужно ли оборачивать дочерний компонент в React.memo?
Given the following code snippet: ```typescript let info = { name: "Alex", skill: ["git", "react", "read"], }; let started = (info: any) => { let { name, skill } = info; (name = "Alex Pool"), skill.push("delete"); return { name, skill, online: true, }; }; ``` Explain what the function `started` does with the `info` object and describe the output of calling `started(info)`. Also, discuss if the original `info` object is mutated after calling `started(info)`.
// Promise.resolve() // .then(() => console.log(1)) // // .then(() => console.log(2)) // // Promise.resolve() // .then(() => console.log(11)) // // .then(() => console.log(22)) //
What will be the output of the following code snippet? ```javascript setTimeout(() => { console.log('B') }, 0) Promise.resolve().then(() => { console.log('C') }) Promise.resolve().then(() => { console.log('D') }) console.log('E') ```
function recursiveFunction(N) { let counter = 0; if (N > 0) { counter = counter + 1; recursiveFunction(N - 1); } // console.log(counter) } recursiveFunction(3); // 3 3 3 ? Explain what the output of the function will be and why. Also, identify any issues with the current implementation of the recursive function and suggest how to fix it to correctly count and log the number of recursive calls.
import "./styles.css"; import React from "react"; const getData = () => { return Array.from({ length: 50 }, (el, idx) => ({ value: Math.random(), label: `row ${idx + 1}`, })); }; export default function App() { const [data, setData] = React.useState(getData()); const handleUpdate = () => { setData((prev) => { return prev.map((row, i) => i === 0 ? { ...row, value: Math.random() } : row ); }); }; return ( <div> <h1>List App</h1> <Button onClick={handleUpdate}>update `row 1`</Button> {data.map((row) => { return <Row key={row.label} label={row.label} value={row.value} />; })} </div> ); }
Расскажите о вашем опыте проведения code review. На что обращали внимание? Какие самые частые ошибки встречали?