Challenge 1: Merge Two Interfaces — Possible Solution ==================================================================== interface Config { port: number; } interface Config { host: string; } // TypeScript merges the two declarations above into a single interface // equivalent to: // interface Config { // port: number; // host: string; // } const config: Config = { port: 3000, host: "localhost", }; // ✅ compiles — both fields are required, from either declaration // const incomplete: Config = { port: 3000 }; // ❌ Property 'host' is missing in type '{ port: number; }' but required // in type 'Config' — the merge is real, not just cosmetic; both // declarations' members are genuinely required on the merged type. // A third declaration merges in too — as many times as needed: interface Config { debug?: boolean; } const fullConfig: Config = { port: 3000, host: "localhost", debug: true, // optional, from the third merge }; WHY THIS WORKS -------------- - TypeScript treats multiple `interface` declarations sharing the same name, in the same scope, as contributions to ONE combined interface — this is fundamentally different from redeclaring a `type` alias, which is a compile error ("Duplicate identifier"). - The merge is unconditional and additive: every declaration's members become required members of the final merged shape (unless individually marked optional with `?`, as `debug` is above). - This mechanic doesn't care whether the declarations are in the same file or different files — which is exactly what makes it useful for module augmentation: a library's own .d.ts file declares `interface Request`, and your separate augmentation file's `interface Request` merges into it without needing to touch the library's source at all.