Tell us about the Event Loop in JavaScript/browser.
Frontend
Tell me about the position property in CSS. What values does it have?
Which CSS selectors are the most expensive for the browser?
Tell about this in different contexts: in object methods, in arrow functions, and in regular functions.
What is CORS and what is it used for?
Tell me about CSS selector specificity. How is it calculated? What is the most specific selector?
import { useState } from "react"; const usePreviousValue = (value: number) => {}; export default function App() { const [count, setCount] = useState(0); const previous = usePreviousValue(count); return ( <div className="App"> <h1>Current Value: {count}</h1> <h2>Previous: {previous ?? "-"}</h2> <button onClick={() => setCount((prev) => prev + 1)}>Click</button> </div> ); }
Tell me about state management: which libraries have you used, and tell me about the Redux architecture.
How to synchronize two browser tabs using localStorage? Talk about the storage event.
Tell me about ways to preserve context in JavaScript: bind, call, apply. How do they differ?
Tell me about the React component lifecycle and hooks (useEffect, useState, useRef, useCallback, useMemo, useLayoutEffect, etc.)
What types are in TypeScript that are not in JavaScript? Tell about utility types.
Tell me about the critical stages of browser rendering (Critical Rendering Path)
What is the difference between the nullish coalescing operator (??) and the logical OR (||)?
Tell about the pattern of lifting state up in React.
function debounce(callback, delay) {}
/** * Type a function that takes an array of objects and a key, * returns an array of objects where this key/property exists **/ const filterArrayByKey = (items, key) => { return items.filter((item) => item[key] !== undefined && item[key] !== null); };
Tell about the defer and async attributes in the script tag. How do they differ?
What is the difference between simple and complex (preflight) requests in the context of CORS?