What is the difference between unknown and any in TypeScript?
Frontend
For the values const a = null and const b = 0, determine the results of expressions with || and ??, and explain the difference between the operators.
Conduct a review of the React component and fix issues in the code. Explain why you are making changes in each case.
For an expression with the || operator, determine the result. How does the || operator differ from the ?? operator and when does ?? trigger?
Solve the TypeScript problem: there is a Response type with mutually exclusive fields payload and error, and their types may differ. You need to type the functions payloadFrom(response), which returns payload or undefined, and errorFrom(response), which returns error or undefined, so that the return types are automatically inferred from the input Response.
Did you have a monorepository or separate repositories for applications and shared libraries?
How to prevent race conditions when making repeated asynchronous requests from useEffect? What native JavaScript tools allow canceling requests?
In the second fragment of React code, find and fix issues with useEffect, useMemo, asynchronous loading of user/roles, and storing computed data in state.
For a counter function with closure, where the message is formed before the call to increment, determine what will be output. How to fix the code so that the actual counter value is displayed?
Is useCallback needed here? What is it used for and when does its use make no sense?
If each micro-frontend adds global base styles of Tailwind CSS and they are duplicated, have you had such a problem?
What are cookies, how do they work, who sets them, and can they be accessed from JavaScript? How does a cookie reach the client and what attributes does it have? Can a cookie live forever?
Did style collisions occur between micro frontends? How was the work with styles organized and through what did you write them?
Tell us how your micro-frontends were organized, their interaction, and the overall system operation.
For an object with an arrow function that outputs this.name, determine what will be displayed and explain the behavior of this in an arrow function.
How would you organize style isolation for each micro-frontend, including when using Tailwind CSS? What browser approaches for isolation exist?
How have you worked with React: which versions have you encountered and have you used class components? How do class components differ from functional ones?
If roles are set as an empty array directly in the component parameters by default, what will happen to useEffect on each render? How to fix this?
Implement your own utility type Pick<T, K>. Explain how mapped types work and how to implement an equivalent of Partial<T>.
If an object is created using Object.create([object]), what will its __proto__ point to?