← All videos

Engineering video

14:05 · 24 September 2024

30 Frontend Interview Questions In 10 Minutes(Senior & Midlevel)

Chapters 13 sections

  1. 0:00Critical Rendering Path and CSS
  2. 0:44Async vs Defer Scripts
  3. 1:09Box Sizing and CSS Optimization
  4. 1:45CSS Specificity and Browser Storage

Key concepts in this video:

1. CSS Rendering and Blocking

CSS is rendered synchronously and acts as a blocking resource because it is a global namespace, requiring the browser to interpret all rules before proceeding with HTML.

Watch section from 0:05 →

2. Script Loading: Async vs. Defer

Async scripts download in the background and execute immediately upon completion, whereas defer scripts download in the background and execute after the DOM finish event.

Watch section from 0:44 →

3. CSS Optimization Techniques

CSS performance can be improved by using browser coverage tools to remove unused styles, applying compression and caching, and extracting critical CSS for initial rendering.

Watch section from 1:22 →

4. Closures in JavaScript

Closures offer simpler function signatures by providing access to outer scopes, but they can increase memory usage because enclosed variables cannot be garbage collected until the function is no longer used.

Watch section from 2:09 →

5. Event Loop and Execution Order

Synchronous code runs first, followed by microtasks like resolved promises, and then tasks are processed across the event loop ticks.

Watch section from 3:03 →

6. ES6 Modules vs. Require

ES6 modules enable static analysis at build time, facilitating optimizations like tree shaking, whereas require resolves modules dynamically at runtime.

Watch section from 4:05 →

7. React Hooks Rules

Hooks must be called at the top level of a component and can only be used inside React components or custom hooks.

Watch section from 5:38 →

8. Concurrent React and Fibers

Concurrent React introduces a priority queue allowing renders to be paused and resumed using fibers, which represent units of work containing component state and props.

Watch section from 6:00 →

9. Server-Side Rendering Rehydration

Rehydration involves taking pre-rendered HTML from the server and attaching the virtual DOM and event handlers via hydrateRoot to make the page interactive.

Watch section from 8:24 →

10. Disadvantages of Global State

Abusing global state can cause excessive re-renders due to widespread component subscriptions, tightly couple code, and make unit testing harder by requiring mocks.

Watch section from 9:23 →

11. Frontend Performance Techniques

Web application speed can be improved using CDNs, asset compression, HTTP caching, bundle splitting with lazy loading, and image optimization formats like WebP.

Watch section from 10:14 →

12. Code Splitting

Code splitting breaks down a large JavaScript bundle into smaller chunks loaded on demand, often mapped to application routes using tools like Webpack and routers.

Watch section from 10:59 →

13. Interaction to Next Paint (INP)

Slow re-renders heavily impact metrics like Interaction to Next Paint by delaying the UI response following a user action.

Watch section from 11:36 →

14. Server-Side Rendering Trade-offs

SSR provides strong SEO and better First Contentful Paint performance, but introduces architectural complexity, frontend-backend coupling, and framework lock-in.

Watch section from 12:19 →

15. Micro Frontends Architecture Challenges

Building micro frontends involves maintaining visual consistency across independently deployed apps, managing integration complexity, and handling shared state like authentication.

Watch section from 13:20 →

Transcript

Hi folks. So today together with Bogdan, we will answer 30 front end interview questions in 10 minutes. Question number one, is CSS rendered before or after the DOM is constructed in the critical rendering path? CSS is rendered before and it's synchronous. So it all has to be interpreted before we start parsing and showing the DOM. On to question number two, HTML is rendered incrementally as is being interpreted.