What is an optional and what problems does it solve?
The idea
Optional<Wrapped> is an enum with two cases: .none and .some(Wrapped). String? is sugar for Optional<String>, and nil is a literal for .none. String and String? are different types: the compiler will not let you use an optional where a value is required until you unwrap it.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep