Suggested approach: Secure hash values use something like SHA-3, which is not the kind of code you'd want to write yourself. Instead, the best approach here is to mention something like Apple's CryptoKit framework, which can do hashing and encryption quickly, efficiently, and correctly.
Estimated difficulty: Intermediate
See the full list of iOS interview questions
Link copied to your pasteboard.