Ok, the RealTimeCounter problem got me thinking. It's a great question. It seems very simple, but as the author notes even PhD's are stumped by it. Here my solution. One very important purpose it serves is to see how well you can identify problems in algorithms. Probably I'm guessing it's not even important that you get it perfect, just that you can recognize and talk through the challenges. One challenge relates to…
Here's the hardware I want added to the computer running the counter server: 4 lasers capable of pulsed operation at a rate of up to one billion pulses per second with a pulse width under 0.1 nanoseconds, 4 light detectors capable of detecting such pulses, and 4 corner reflectors.
The corner reflectors shall be placed 1/2 light second, 30 light seconds, 30 light minutes, and 12 light hours away from the computer, and each laser aimed at a different one of the corner reflectors. The detectors should be placed next to the lasers so as to detect the return pulses from the corner reflectors.
The computer then maintains 4 counters. When increment is called, each of the counters is incremented, and a pulse is sent toward each corner reflector. The return pulses decrement the counters, with the detector associated with the first reflector detecting the one second counter, and so on.
I realize there are some practical problems here, such as one of the corner reflectors needing to be placed approximately 90 AU from the computer. Of course the path could be folded using reflectors, and maybe could be sent through a medium with a high index of refraction to further reduce the distance needed, but my guess is that it would still be a bit out of range of current technology.