Fundamental Web Development Concepts
What this domain covers
Expect questions on the request/response cycle, HTTP semantics, the DOM, CSS cascade and specificity, and JavaScript execution order. You should be comfortable describing how a browser turns HTML into a DOM, applies CSS via the cascade, and blocks rendering while parsing synchronous scripts.
Concepts to know
- HTTP methods and status codes: GET is safe and idempotent; POST is neither. Know 200, 201, 204, 301 vs 302, 304, 400, 403, 404, 500. A 304 means the cached copy is still valid.
- Caching headers:
Cache-Control,ETag,Last-Modified,Vary.Varymatters when responses differ by header (e.g., cookies, Accept-Encoding). - CSS cascade: origin and importance, specificity, source order. Specificity is (inline, IDs, classes/attributes/pseudo-classes, elements/pseudo-elements).
- Box model and layout:
box-sizing: border-boxincludes padding and border in declared width. - JS event loop: synchronous code runs first, then microtasks (promises), then macrotasks (timers, I/O callbacks).
Traps in questions
Questions often swap 301 and 302, or claim GET is non-idempotent. Another common trap: assuming a higher-specificity selector wins regardless of !important; importance is compared before specificity. Also watch for the assumption that defer and async behave identically - defer preserves order and waits for parsing; async executes as soon as downloaded.
Rule of thumb
When two rules conflict, resolve in this order: importance, then origin, then specificity, then source order. If you can recite that chain, most cascade questions become mechanical.
Worked example: #nav .item a vs .menu .item a:hover. First has specificity (0,1,2,1); second (0,0,3,1). The ID selector wins on the second component, so the first rule applies despite fewer classes.