Sobes.tech

type Foo = { a: string; b: number; c: null; d: boolean; } // FooKeys type FooKeys = keyof Foo // How to declare a new type based on FooKeys, but without the values b and d? type FooKeysWithoutBD

Middle+
202

What does a component re-render in React depend on?

Middle+
186

How to declare a new type based on Foo, but without fields a and c, without using Omit?

Middle+
183

How to make try/catch construct work with Promise? How to make Promise synchronous using async/await?

Middle+
181

In what order will console.log be output and why? Explain the order of execution of synchronous and asynchronous code (Event Loop, macro- and microtasks).

Middle+
155

How to make a function with a Generic accept only a string or an instance of class Bar, and throw a TypeScript error in other cases?

Middle+
151

What was your approach to writing CSS? Are you familiar with the CSS-in-JS approach?

Middle+
143

function delayFunc(fn, delay) { return function c(...args) { return new Promise((resolve) => { setTimeout(() => { fn(...args) }, delay * 1000) }) } } function sum(a, b) { console.log(a + b) } const delayedSum = delayFunc(sum, 5); await delayedSum(3, 2); // after 5 seconds, outputs 5 await delayedSum(5, 3); // after 5 seconds from the previous, outputs 8

Middle+
140

Why pass a function (c => c + 1) to setCount instead of just setCount(tick + 1)?

Middle+
139

<div class="list"> <div class="item">1</div> <div class="item">2</div> ... <div class="item">N-1</div> <div class="item">N</div> </div>

Middle+
136

Can the same be implemented through setTimeout instead of setInterval?

Middle+
134

What is a dependencies array in useEffect? What happens if you pass an empty array or do not pass it at all?

Middle+
130

Tell about the most complex task in your entire experience.

Middle+
130

How to make the result type not 'any', but match the argument type using Generics?

Middle+
126

There is an App component and a Rand component from a third-party library that outputs a random number. How to make the random number change every 3 seconds and display a counter of the number of changes? All in the App component.

Middle+
121

// It is necessary to move the re-render logic to a separate external hook, // which allows working with the timer from outside (for example, stopping it after 10 seconds). // Create a new RandOnce component based on the Rand component, // which when used in App // will not update the random number every 3 seconds, but will output a random number only once.

Middle+
121

How does the keyword 'type' differ from 'interface' in TypeScript? Explain inheritance in types and interfaces.

Middle+
121

You have assessed the task, taken it on, and realize that you have estimated it incorrectly and cannot complete it on time. What do you do at this moment?

Middle+
119

What ways are there to handle errors in Promise? Can try/catch be used?

Middle+
116

Tell us about your work experience. How was the task planning process organized?

Middle+
116
/2