There is a function customMap, which does almost the same as the usual array map, but it is not typed. You need to type it so that on the fifth line there is an array of strings, and on the seventh — an array of numbers.
Frontend
Do you know what the FCP (First Contentful Paint) metric is? Suppose we have a React app — a social network with server-side rendering, and there's a problem: when a user directly accesses someone's profile, they see a white screen for a long time. Can you walk through the steps — what happens from the moment the user presses Enter until the first content appears?
Did you enjoy working with Redux as a state manager for complex forms?
How would you implement client-side caching?
Tell a little about yourself, what interests you in programming, about your recent experience, maybe some complex things you've done.
console.log(1) setTimeout(() => { console.log(2) }, 10) setTimeout(() => { Promise.resolve().then(() => console.log(3)) }, 0); setTimeout(() => { console.log(4) }, 0); new Promise((_, reject) => { console.log(5) reject(6) console.log(7) }).then(() => console.log(8)) .catch(() => console.log(9)) .then(() => console.log(10)) .catch(() => console.log(11)) .then(() => console.log(12)) .then(console.log) .finally(() => console.log(13)) console.log(14)
Enhancement of the memoize task: make the memoize function accept cache lifetime in milliseconds as the second argument, after which the cache is invalidated.
There is code — need to understand what it does, do a code review: what problems are there and what can be improved.
How does resource caching work in the browser — how does the browser decide whether to take from cache or load anew, and how to manage this? What are the caching methods, including Service Worker?
Recently, the helper Promise.withResolvers appeared in JavaScript. Have you heard of it? Write its equivalent instead of the second line.
What is your opinion on the FSD (Feature-Sliced Design) methodology?
Can you name a couple of advantages and disadvantages of Redux?
There is a list of 5000 products on the page, and the page lags heavily. The business asks to do something about it. What would you suggest?
On the friends page and in the messenger, similar user information is displayed. There are two options: store users in local feature slices or in a global store. What are the pros and cons of a global store in this case?
What happens if you put the async attribute on a script in the head? What is the difference between async and defer?
Tell us about your previous workplaces — what interesting things did you do?
How can you get data from another feature's slice (for example, users slice) on a specific user's page without breaking module boundaries and without making an unnecessary request?
What alternatives to Redux do you know, and why do they lack its advantages? Why is Redux well-tested, but contexts are not?
#React signup form 1. Explain how StateProvider works, share your thoughts with interviewer. 2. Take a look at /src/api/mock, explain how it works. 3. Check SubmitButton color and fix it 4. Implement client form validation in Signup component. (\*\*) Keep in mind task number 9. Rules: - Username, Email, Password, Repeat Password fields should have at least 6 characters length; - Password should match Repeat Password; - Validation should be done upon "Sign Up" button click; - Fields that have invalid values should be marked (error and helperText props); 6. API response may have an error that should be displayed to user near corresponding field. 7. Make sure that UserName component renders new username after successful submit. 8. Implement the new SignupSuccess component. It should be shown instead of sign up form. 9. Implement server validation for appropriate fields.
Can you briefly tell about your last experience and what you generally want from a new job, what do you expect from a new position?