Tell me about the Event Loop in JavaScript: what does it consist of and in what order are synchronous code, microtasks, and macrotasks executed?
Frontend
Have you ever used call, apply, and bind methods? Explain their purpose and differences.
What is Dependency Injection in Angular and how can dependencies be injected?
You have a ready desktop-only web application for CRM/Service Desk that looks bad on mobile devices. The mobile version design is already prepared and significantly differs from the desktop version. How would you organize adaptation of the application for mobile browsers?
How reliably can you determine whether the application is opened on a mobile device or on a desktop to choose the appropriate interface version?
Why is DI necessary in Angular if dependencies can be created with new or stored in global state?
You are a tech lead of a team of 3-4 frontend developers. A new large-scale CRM or Service Desk web product with a ready backend has appeared. How will you choose the technology for the frontend part?
What will the component render if the decorator specifies template: './user.component.html' instead of templateUrl? Is such a record valid?
Explain the problem with the following Angular component code and how you would fix it: ```typescript @Component({ selector: 'app-user', template: './user.component.html', stylesUrls: './user.component.scs', changeDetection: ChangeDetectionStrategy.OnPush, }) export class CmfUserComponent { users$: any; constructor() { const api = new BackendService(); this.users$ = api.getUsers(); } } ```
If different sets of components are used for desktop and mobile versions, but the services are shared, how to organize switching between versions?
How good is the practice of subscribing to an Observable directly in Angular component code? What are the risks and alternatives?
How justified is a complete rejection of NgModule in new Angular projects? In which cases might modules still be needed?
Tell me about the keyword this in JavaScript: what does its value depend on when calling a function? What are the features of arrow functions?
Have you ever used DI decorators like @Optional, @Self, @SkipSelf, and @Host? Explain how they influence dependency search in the hierarchy of injectors.
What is the difference between where a function is declared and where it is called, in the context of the value of this?
What are the advantages of the inject() function in Angular compared to dependency injection via constructor?
If you declare a function inside another function, what will it have access to? How will this work with this in a nested regular function?
What is change detection in Angular? How do the Default and OnPush strategies differ, and when is a component with OnPush checked?
Is it permissible to assign an Observable directly to a component field in the constructor or at field initialization? What is the difference from subscribing in the constructor?
At what levels can services be provided via providers in Angular: component, route, module, application, platform?