Tell about memoization in React: useMemo, useCallback, React.memo. When to use them?
Frontend
const X = { a: 1, b: 2, c: 3, d: 4 } function getProperty<T>(obj: T, key: keyof T) { // Type the function return obj[key] } getProperty(X, 'a') // no error getProperty(X, 'e') // error: key 'e' is not a key of object X getProperty({ name: 'Sergey' }, 'name') // no error getProperty(1, 1) // Error. First argument must be an object (not a function or primitive)
Why did you use JSON.stringify? Could you have used a Map instead of an object for caching?
Tell about your experience in your own words, what you would like to highlight, interesting technical moments from your resume.
const { foo: [bar], bar: [{ baz: foo }] } = { foo: [1], bar: [{ baz: 3 }] } console.log(bar) // 1 console.log(foo) // 3
Please tell me, what is the difference between Map and object?
What is scope of visibility? What are the scopes of variables?
const submit = (el) => () => { log(el); } arr.map(el => <button onClick={submit(el)}/>) arr.map(el => <SomeComp key={} pmclick={() => submit(el)} />) const param = useMemo(() => ([c: a + b]), [a,b]) return <Child value={param} /> Child = React.memo(() => {})
Where can we store state on the client side? Tell about them.
What is the difference between a function expression and a function declaration?
How often have you worked with the context (this) in JavaScript? Explain the loss of context and ways to solve it (bind, call, apply, arrow functions, saving in a variable).
Tell about data storage: cookies, localStorage, sessionStorage. How was authorization with tokens implemented in your project?
let a = 2 function foo() { console.log(a) } function bar() { let a = 1 foo() } bar() //
Tell me about Promise: statuses, static methods (all, allSettled, any, race).
Are you familiar with tools like Confluence, Jenkins, and internal services (EFS, RMC)?
If a Promise is not resolved but rejected, where can we catch the error? What else besides then and catch exists? When does finally execute?
const X = { a: 1, b: 2, c: 3, d: 4 } function getProperty(obj, key) { // Type the function return obj[key] } getProperty(X, 'a') // no error getProperty(X, 'r') // error, key r is not a key for object X getProperty({ name: 'Sergey' }, 'name') // no error
Tell about your role in the team: were you a leader, a right-hand man, did you have experience making independent decisions? How were roles delegated?
What does the 'in' operator do in TypeScript?
Does the Event Loop work the same in Node.js and in the browser?