TITLE: Can an algorithm be faster than O(1)?
QUESTION [14 upvotes]: This week we had a bright interviewee who claimed that array has constant search time and map has even faster than that search time. Now to me if some algorithm has O(1) time complexity the only way for another equivalent algorithm to be faster is to have a smaller constant coefficient in O(1) estimate (like one algorithm takes at most 230 primitive operations and another takes at most 50 primitive operations and is therefore faster although both have O(1) complexity).
Is it possible for an algorithm to be faster than O(1) except having a smaller coefficient in the estimate?

REPLY [5 votes]: Others have already argued that in the context of sequential algorithms and classical models of computation (e.g., Turing machines or the RAM model), a running time of $0$ makes little sense. However, other models exist.

In the context of distributed algorithms, we usually define that the running time of an algorithm equals the number of communication rounds.
With this definition, we have got not only non-trivial graph algorithms with running time $O(1)$, but also some graph algorithms with running time $0$.
As a simple example, the randomised 2-approximation algorithm for maximum cut has running time $0$ in this model: there is no need to communicate with the neighbours; each node (simultaneously in parallel) just flips a coin and produces its own local output based on the random coin flip.

So it is not just the case that one could, hypothetically speaking, define a model of computation in which a running time of $0$ would make sense, if we abuse some contrived definition of "time".
We do have such models, they are actively studied, and the definition of "time" is natural for these purposes. In particular, with precisely this definition, time (number of communication rounds) and distance (shortest-path distance in the graph) become more or less equivalent concepts.