Your question is Mobile Threading, Deadlocks, and Memory Safety. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
You are responsible for a mobile app that handles login, biometric prompts, and a cached session token used to call protected APIs. A recent release introduced intermittent freezes during sign-in, and crash reports suggest the UI thread is sometimes blocked while background work is still running. You also suspect that shared state around the token cache may be accessed concurrently from multiple threads.
How would you explain what is happening in this app from a threading perspective, and how would you diagnose whether the issue is a deadlock, a race condition, or a memory-safety problem? What changes would you make to keep the app responsive and safe under concurrent access?