What’s happening in this Kotlin code?
A Kotlin coding challenge demonstrates a shared-reference mutation bug when copying a user object.
“They create a new user from an existing one. Then they add a role to the new user. Somehow the original user gains that role, too.”
Google Developers posted a Kotlin coding puzzle asking viewers to spot a permissions bug where copying a user object shares a mutable role collection, so changes to the copy affect the original. It is an educational engagement post with no meaningful AI industry signal.