Algorithm · Google · Medium
Requirements Accept either an integer array or a stream of log/chat records in which every line associates a key, such as a user ID, IP address, or word, with an event. Produce the K keys that occur most often. Unless otherwise specified, the order of those K keys does not matter. Explain whether the running time can be improved beyond O(N log N), review the standard solution families, and select one approach to implement or describe. Be prepared to write pseudocode for at…
Checking your access…