Programming Languages and Web Technologies
Programming languages and web technologies tests language paradigms, binding and scope, type systems, parameter passing, object-oriented and functional features, and core web standards: HTML, CSS, JavaScript, HTTP, sessions, and basic security.
Core rules and concepts
- Static scope is resolved at compile time from the lexical environment; dynamic scope uses the call chain. Deep binding captures the environment at procedure creation; shallow binding uses the caller’s environment.
- Pass-by-value copies the argument; pass-by-reference aliases it; pass-by-value-result copies in and out. Java passes primitives by value and object references by value, so reassigning the parameter does not affect the caller.
- Object-oriented languages support encapsulation, inheritance, and polymorphism; dynamic dispatch selects an overriding method at run time.
- In CSS, specificity is compared as inline, IDs, classes/attributes/pseudo-classes, then elements/pseudo-elements; later rules win only on ties.
- HTTP is stateless; cookies and server-side sessions add state. Same-origin policy restricts script access across origins.
Worked example
Compare selectors #nav .item a and .menu .item a. The first has specificity (0,1,1,1): one ID, one class, one element. The second has (0,0,2,1): two classes and one element. The ID selector wins, so its declarations apply even if the second rule appears later. If both had equal specificity, source order would decide.
Traps that cost marks
Saying JavaScript objects are passed by reference-the reference is passed by value; confusing var hoisting with the let temporal dead zone; assuming == and === behave the same; and treating HTML as a programming language. In web security, do not confuse XSS (script injection) with SQL injection (database query manipulation).