How does Swift's Dictionary work under the hood?
Walk through Swift Dictionary as a CoW hash table — hashing invariants, collisions, complexity traps, nil removal, ordering, concurrency, and key design for senior interviews
Q/A library
Search by title or keywords, narrow by topic, difficulty, or tag, then open a question for a full write-up with code to practice your answer.
Walk through Swift Dictionary as a CoW hash table — hashing invariants, collisions, complexity traps, nil removal, ordering, concurrency, and key design for senior interviews
Demonstrate Copy-on-Write with a value-typed linked list that shares storage on assignment and copies it only when a mutation occurs using isKnownUniquelyReferenced.
Under ARC, strong keeps an object alive, unowned tracks a direct non-owning pointer that must outlive use, and weak goes through a side table so access can become nil after deinit
Compare language-level isolation with traditional queue-based synchronization in production iOS code
Group design patterns into creational, structural, and behavioral, then explain real iOS examples from SDKs and your own implementation experience with the tradeoffs that matter in production
Explain MemoryLayout, padding, alignment, and stride; show why stored-property order changes a struct's footprint; and connect it to arrays, performance, and low-level interop