What’s happening in this Kotlin code?

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A Kotlin code puzzle where creating a new user from an existing one and adding a role to the new user unexpectedly also grants that role to the original user. The challenge asks developers to identify the bug, which likely involves shallow copying and shared object references rather than a true deep copy.

1m watch time
336 Impressions