Apple interview question

Medium leetcode problem of hashing System design Notification module