Algorithms, Networking, Networking Interview, System Design Interview.
var receivedId = receiveMessage(); if (receivedId > id) { // Another process has a higher id, not the leader return; } else if (receivedId === id && processes[i] < processId) { // Another process has the same id, but a lower process id, not the leader return; } } Conclusion Distributed algorithms