Appendices: Projects, Interview Questions, Cheat Sheet & Resources

Capstone projects, interview questions, a WAT and toolchain cheat sheet, a language-to-Wasm comparison, and resources with a study plan.

Appendix A: Capstone Projects

Beginner: Hand-Written WAT Library. Implement math utilities (gcd, isPrime, fib, factorial with i64), a bump allocator, and string reversal in linear memory. Test with Node and .wast scripts.

Beginner: Image Filter Playground. Grayscale/blur/sharpen filters in C (Emscripten) or Rust (wasm-bindgen) on canvas ImageData. Compare against a JS implementation.

Intermediate: Markdown Editor with Rust Parser. Use pulldown-cmark compiled with wasm-pack, live preview, a Web Worker, size-optimized build.

Intermediate: Port a C Library. Port an existing library (e.g., a QR code encoder, zlib, or a chess engine like Stockfish-lite) with Emscripten, Embind/TypeScript types, and npm publishing.

Intermediate: SIMD + Threads Benchmark. A Mandelbrot/matrix-multiply in scalar, SIMD, and multi-threaded variants (COOP/COEP setup), with a performance report.

Advanced: Browser Game. Rust (Bevy or macroquad) or C++ (SDL2 + WebGL) game: input, audio, asset loading, a 60 FPS loop, deployed to static hosting.

Advanced: Plugin System. A Rust or Go host application with Wasmtime/wazero running user plugins (Rust, TinyGo, AssemblyScript) behind a WIT interface, with fuel limits and capability restrictions.

Advanced: Polyglot Components. A Rust component (business logic) + a Python component (componentize-py) + a JS component composed with wac, run in Wasmtime and in Node via jco.

Advanced: Edge API with Spin or wasi:http. A REST API with key-value/SQLite storage, outbound HTTP, tests, deployed to SpinKube or a cloud platform.

Advanced: Mini Wasm Interpreter. Write a decoder + interpreter for a subset of Wasm (i32 ops, locals, control flow, memory) in your favorite language, and validate it against spec tests.

Data: In-Browser Analytics Dashboard. DuckDB-Wasm querying Parquet files locally, charts, offline-capable PWA.

AI: Local Inference Demo. ONNX Runtime Web or llama.cpp (Wasm + SIMD/threads, plus WebGPU where available) for in-browser image classification or text generation.

Appendix B: Interview Questions

What is WebAssembly, and what problems does it solve? How does it relate to JavaScript?

What are Wasm's design goals?

Module vs instance: what's the difference?

Explain the stack machine model with an example.

What are Wasm's value types? Why does i64 map to BigInt in JS?

What is linear memory? How is it sized and grown? What happens to JS views after growth?

What is a trap? Give examples.

Why is Wasm's control flow structured (blocks/loops) instead of using arbitrary jumps?

What are tables and call_indirect used for?

What's the difference between WAT and the binary format? What is LEB128?

instantiateStreaming vs instantiate vs new WebAssembly.Instance?

How do you pass strings and arrays between JS and Wasm?

What does wasm-bindgen generate? What does Emscripten's JS glue do?

What are externref and JS String Builtins?

How do you minimize JS↔Wasm overhead?

What MIME type and headers does Wasm need (for streaming, threads)?

Languages and Toolchains Emscripten vs bare Clang vs wasi-sdk: when do you use each?

Rust targets: wasm32-unknown-unknown vs wasm32-wasip1 vs wasm32-wasip2?

What is AssemblyScript, and how does it differ from TypeScript?

Why are Go Wasm binaries large? What does TinyGo change?

What is WasmGC, and why does it matter for Kotlin, Dart, and Java?

Explain bulk memory, multi-value, and reference types.

How does Wasm SIMD work? What is relaxed SIMD?

How do threads work in browser Wasm? Why is cross-origin isolation required?

Explain Wasm exception handling (try_table, tags) and how C++ uses it.

What are tail calls and typed function references?

What problem do Asyncify and JSPI solve? How do they differ?

What does Memory64 enable, and what are its trade-offs?

WASI and Components What is WASI? Explain capability-based security.

WASI Preview 1 vs WASI 0.2 vs 0.3?

What is the Component Model? What is the Canonical ABI?

Explain WIT: interfaces, worlds, records, variants, resources.

How do you compose components written in different languages?

Compare Wasmtime, Wasmer, WasmEdge, WAMR, and wazero.

How do you optimize Wasm code size? Name the tools.

How do you debug Wasm built from C/C++ or Rust?

What security guarantees does the Wasm sandbox provide, and what doesn't it protect against?

How would you design a secure plugin system using Wasm?

Why is Wasm attractive for serverless/edge computing?

How do engines compile and execute Wasm (tiering, guard pages)?

Write a WAT function that computes the sum of an i32 array in linear memory.

Implement strlen in WAT for a null-terminated string.

Write a JS helper that passes a UTF-8 string to Wasm and reads one back.

Expose a Rust struct with methods to JS using wasm-bindgen.

Write a WIT interface for a key-value plugin, and implement it in Rust.

Implement a SIMD dot product in C with wasm_simd128.h.

Embed Wasmtime in a Rust program with a host function and fuel limiting.

Appendix C: WAT and Toolchain Cheat Sheet

block loop if else end br br_if br_table return call call_indirect call_ref return_call unreachable nop try_table throw

local.get local.set local.tee global.get global.set *.load *.store memory.size memory.grow memory.fill memory.copy memory.init data.drop

table.get table.set table.size table.grow table.fill table.copy table.init elem.drop

ref.null ref.is_null ref.func ref.as_non_null ref.test ref.cast

struct.new struct.get struct.set array.new array.get array.set array.len ref.i31

*.atomic.load/store/rmw.* memory.atomic.wait32 memory.atomic.notify atomic.fence

(module
  (type $t (func (param i32) (result i32)))
  (import "env" "log" (func $log (param i32)))
  (import "env" "mem" (memory 1))
  (memory (export "memory") 1 10)
  (table 4 funcref)
  (global $g (mut i32) (i32.const 0))
  (data (i32.const 0) "hi")
  (elem (i32.const 0) $f)
  (tag $err (param i32))
  (func $f (export "f") (type $t)
    (local $x i32)
    local.get 0
    i32.const 1
    i32.add
    local.tee $x
    call $log
    (if (i32.gt_s (local.get $x) (i32.const 10)) (then (throw $err (local.get $x))))
    (block $b (loop $l (br_if $b (i32.eqz (local.get $x))) (local.set $x (i32.sub (local.get $x) (i32.const 1))) (br $l)))
    (i32.load (i32.const 0)))
  (start $init) (func $init))
# WABT / wasm-tools / Binaryen
wat2wasm in.wat -o out.wasm          wasm2wat in.wasm
wasm-objdump -x -d in.wasm           wasm-validate in.wasm
wasm-tools print/parse/validate/strip/component/compose
wasm-opt -O3 | -Oz in.wasm -o out.wasm
# Emscripten
emcc app.c -O3 -o app.js -sMODULARIZE -sEXPORT_ES6 -sEXPORTED_FUNCTIONS=_f
# Rust
cargo build --target wasm32-unknown-unknown --release
wasm-pack build --target web         cargo component build --release
# Runtimes
wasmtime run --dir . app.wasm        wasmtime serve http.wasm        wasmer run app.wasm
# Components
jco transpile comp.wasm -o out       wac plug a.wasm --plug b.wasm -o c.wasm

Appendix D: Language-to-Wasm Comparison

Typical hello-world size Emscripten / wasi-sdk ~1–20 KB (no stdio) to 100+ KB Porting native libraries, games, codecs wasm-bindgen / cargo-component ✅ (best support)

New Wasm code, web apps, plugins, components Web devs wanting TS-like syntax GOOS=js / wasip1 Go GC in linear memory Reusing Go code Plugins, small binaries Small, fast modules Blazor / wasi workload.NET teams, Blazor apps Compose Multiplatform web Pyodide / componentize-py

Data science in the browser, scripting plugins Javy / ComponentizeJS ~MBs (embeds engine) JS plugins on Wasm hosts Compact Wasm-native apps

Sizes vary widely with features and optimization. Measure your own builds.

Appendix E: Resources and Study Plan

Official and Reference webassembly.org (spec, feature status), webassembly.github.io/spec, github.com/WebAssembly/proposals

MDN WebAssembly guides (JS API, WAT concepts), component-model.bytecodealliance.org (Component Model book), wasi.dev, bytecodealliance.org

Emscripten docs (emscripten.org), Rust and WebAssembly book (rustwasm.github.io/docs/book), wasm-bindgen guide, AssemblyScript docs, Wasmtime docs, Spin docs, Extism docs Books and Learning

*WebAssembly: The Definitive Guide*: Brian Sletten (O'Reilly)

*The Art of WebAssembly*: Rick Battagline *WebAssembly in Action*: Gerard Gallant

*Programming WebAssembly with Rust*: Kevin Hoffman *Hands-On Game Development with WebAssembly*: Rick Battagline

*WebAssembly from the Ground Up* (online book: building a compiler targeting Wasm)

Wasm by Example, Exercism WebAssembly track, Lin Clark's illustrated Wasm articles, the WasmCon/Wasm I/O conference talks, the Bytecode Alliance blog, Fermyon/Cosmonic/Wasmer blogs, the "WebAssembly Weekly" newsletter 10-Week Study Plan Concepts, toolchain, WAT basics

Instructions, control flow, functions, memory, tables/globals

JS API, data passing, binary format, validation/traps, Node/Deno

C/C++ with Emscripten and Clang/wasi-sdk Rust, AssemblyScript, Go/TinyGo, other languages

Bulk memory, reference types, SIMD, threads, exceptions, tail calls

WasmGC, memory64/proposals, async (Asyncify/JSPI) WASI, runtimes, embedding, Component Model, composition

Graphics/games, Wasm UIs, server/edge, plugins, data/AI, containers 40–48 + Capstone

Performance, size, debugging, testing, security, deployment, internals, best practices

Final tip: Start by hand-writing a little WAT (it demystifies everything), then pick one source language (Rust or C/C++) and ship something real to the browser. After that, explore WASI and the Component Model: that's where Wasm is heading as a universal, secure, polyglot runtime well beyond the web. Happy hacking! 🧩