Algorithm · Google · Medium
Requirements Read records from a stream of user pairs, such as Lena-Marc or Marc-Nia. Whenever a pair is accepted, treat the two users as having an active communication. Keep the number of active communications associated with every user. Produce the users sorted from the largest communication count to the smallest. Before implementing, establish how users with equal counts should be ordered; the requirements demand sorted output but do not prescribe a universal tie-break…
Checking your access…