You usually don't need to re-implement an algorithm.
But very often you have to understand which algorithm to choose. Then you can pick an existing implementation.
In interviews I conduct I gladly allow to read the wikipedia page with a reference implementation (say, for the mentioned Dijkstra algorithm), or pick an implementation from a standard library of a language (say, for a priority queue). What I'm looking for is a conscious and reasonable choice of an approach, and understanding its trade-offs.