Appendices: Projects, Interview Questions, Cheat Sheet & Resources
Capstone projects, interview and review questions, a V cheat sheet, V for Go / Rust / Python / C developers, and resources.
Appendix A: Capstone Projects
Beginner: CLI To-Do App. Commands with the cli module, JSON file storage, colored output with term, and unit tests.
Beginner: Number Guessing and Quiz Game. rand, os.input, loops, match, error handling with or {}.
Intermediate: Markdown Notes Server. veb + templates + SQLite ORM. CRUD notes, Markdown rendering (the markdown package), search.
Intermediate: Concurrent Web Scraper. net.http + spawn worker pool + channels + net.html parsing, rate limiting, CSV export.
Intermediate: REST API with Auth. veb, JWT (HMAC via crypto.hmac), password hashing (crypto.bcrypt), PostgreSQL via db.pg + ORM, middleware, Docker deployment.
Advanced: Interpreter/Compiler for a Tiny Language. Scanner, parser (sum-type AST), tree-walking evaluator, REPL. Bonus: emit C or bytecode.
Advanced: 2D Game with gg. Sprites, input, collision, game states, hot reload (@[live]), plus web builds via emscripten and Android via vab.
Advanced: C Library Wrapper. Wrap libcurl, raylib, or zlib with C. declarations plus an idiomatic V API, and publish to VPM.
Advanced: Real-Time Chat. WebSockets (net.websocket) + veb + shared state with lock, message history in SQLite.
Systems: File Sync / Backup Tool. os.walk, hashing (crypto.sha256), compression (compress.gzip), concurrency, cross-compiled binaries for Windows, Linux, and macOS.
Tooling: Linter Using the V Compiler Library. Parse V files with v.parser, walk the AST, report custom rules.
Appendix B: Interview and Review Questions
What are V's main design goals? How does V compile code (which backends)?
Difference between := and =? What does mut do?
Why doesn't V allow variable shadowing or (by default) global variables?
What are the zero values for each type?
How do you write a ternary in V?
What forms can a for loop take?
Why must match be exhaustive?
How do you pass arguments by mutable reference?
How does V emulate named and default parameters?
What's the difference between []int, [5]int, and [1, 2, 3]!?
Types and Errors Explain struct field access modifiers (mut:, pub:, pub mut:).
How does struct embedding work? Does V have inheritance?
How are interfaces implemented in V (implicit vs implements)?
What is a sum type? How do smart casts work with is and match?
Explain ?T vs !T. How do you propagate and handle each?
How do you create a custom error type?
How do generics work? What syntax do they use now?
How do closures capture variables in V?
What memory management modes does V support? What is autofree's status?
When is unsafe required?
What is $if? Name common compile-time conditions.
How does compile-time reflection ($for field in T.fields) work, and where is it used?
What do $embed_file and $tmpl do?
How do spawn, thread T, and .wait() work?
How do channels and select work? How do you detect a closed channel?
What is shared, and why must you use lock/rlock?
How do you call a C function from V? How do you link a library?
How do you build a shared library from V?
Which operators can be overloaded?
How do custom iterators work (next() ?T)?
How does V's ORM prevent SQL injection and type errors?
How do you cross-compile a V program for Windows from Linux?
What's the difference between -prod, -g, and -cg?
What are the current limitations of V you must consider for production?
Implement a generic Queue[T] with push, pop() ?T, and len().
Implement a JSON-like recursive sum type and a pretty printer.
Write a concurrent prime sieve using channels.
Build a worker pool with sync.WaitGroup that processes URLs.
Write a veb endpoint that validates input and stores it via the ORM.
Wrap C.qsort with a V comparator.
Use $for reflection to generate a CSV header and rows from any struct array.
Appendix C: V Cheat Sheet
// ===== Basics =====
name := 'V' // immutable
mut n := 0 // mutable
n += 1
const max = 10
println('${name} ${n}')
x := if n > 0 { 'pos' } else { 'neg' }
// ===== Control flow =====
for i in 0 .. 5 {}
for i, v in [1, 2] {}
for k, v in {'a': 1} {}
for n < 10 { n++ }
for {}
match n {
0 { println('zero') }
1...9 { println('digit') }
else {}
}
// ===== Functions =====
fn add(a int, b int) int { return a + b }
fn divmod(a int, b int) (int, int) { return a / b, a % b }
fn inc(mut x int) { x++ }
fn sum(nums ...int) int { return 0 }
fn find(id int) ?string { return none }
fn load(p string) !string { return error('fail') }
v := load('x') or { 'default' }
f := fn [n] (x int) int { return x + n }
// ===== Collections =====
mut arr := [1, 2, 3]
arr << 4
evens := arr.filter(it % 2 == 0)
sq := arr.map(it * it)
mut m := map[string]int{}
m['a'] = 1
val := m['b'] or { 0 }
// ===== Types =====
struct Point {
x int
mut:
y int
pub mut:
z int = 5
}
fn (p Point) str() string { return '${p.x}' }
fn (mut p Point) move() { p.y++ }
enum Color { red green blue }
type Shape = Circle | Square
interface Speaker { speak() string }
type Id = int
// ===== Generics =====
…v run app.v | v -prod app.v | v fmt -w . | v vet . | v test . | v doc . | v install pkg | v up | v -os windows app.v | v -live run app.vAppendix D: V for Go / Rust / Python / C Developers
Result<T, E> / ? !T + or {} / ! type A = B | C goroutines, channels threads, async threads, asyncio spawn, chan, shared GC / autofree / manual Key gotchas:
Go devs: V uses single quotes for strings, [T] generics, no nil (use options), immutable by default, mut needed at call sites, and no shadowing.
Rust devs: there's no borrow checker (GC by default), results use !T with or {} blocks, and there are no traits (use interfaces).
Python devs: V is statically typed and compiled, uses braces instead of indentation, and has no exceptions.
C devs: strings are immutable UTF-8 objects, arrays are bounds-checked, and memory is GC-managed by default.
Appendix E: Resources
vlang.io: Homepage, V Documentation (docs.vlang.io / doc/docs.md in the repo), modules.vlang.io (stdlib reference)
github.com/vlang/v: Source, examples (examples/ folder), CHANGELOG, issues play.vlang.io: Online playground vpm.vlang.io: Package registry
V Discord, GitHub Discussions, r/vlang *Getting Started with V Programming*: Navule Pavan Kumar Rao (Packt)
Exercism V track, V by Example (vlang-by-example), Rosetta Code V solutions, Advent of Code in V repos
Real-world code: vlang/v (the compiler), vlang/gitly, vlang/vinix, vlang/ui, vlang/vab, vlang/v-analyzer, vlang/vsl Suggested 8-Week Study Plan
Setup, syntax, variables, types, operators Control flow, functions, strings
Arrays, maps, structs, methods, enums, modules Interfaces, sum types, options/results, generics, closures, memory, attributes
Comptime, concurrency, shared state, C interop, unsafe, operators, backends
Stdlib, files/OS, JSON, ORM/DB, networking veb web apps, gg graphics/GUI, CLI tools 38–46 + Capstone
Testing, docs, VPM, builds/cross-compiling, debugging, performance, c2v, best practices, internals
Final tip: V is small, so read the whole official docs page once, browse the examples/ folder, run v up often (and pin a version for production), and build something real: a CLI tool, a veb app, or a game with gg. Happy coding! ✌️