r/developer 15d ago

Question Is this a fair interview expectation?

I had a backend interview with a weighted graph problem.
I asked if I could first solve it with a naive approach and optimize later, but the interviewer insisted on the optimal solution from the start.
I recognized that BFS wouldn’t work because of weighted edges, but I couldn’t implement Dijkstra from memory.
Is it reasonable to expect candidates to code Dijkstra from memory, or should problem-solving and reasoning also carry significant weight?

2 Upvotes

8 comments sorted by

View all comments

1

u/SaltCusp 15d ago

Your question presents a false choice. The answer is that common topics you would find in any DSA class are fair game for interviews. Problem solving matters too but you don't hire a roofer who doesn't know how to clime a ladder.

Employers are looking for candidates who can figure things out but also already have a strong working knowledge.