1. When would you use the Keychain rather than `UserDefaults` for persistence in Swift, and what are some best practices for storing sensitive data?
You use Keychain when storing sensitive data such as authentication tokens, passwords or biometric keys. `UserDefaults` is fine for simple, non-critical preferences. /n/n Best practices include: store only minimal necessary data, enforce access control when retrieving data, handle keychain errors, use secure access groups for shared data, use `kSecAttrAccessibleWhenUnlocked` or stricter policies, and avoid storing plain text secrets. Showing you think about security in persistence matters in interviews.