← Quant playground

Free practice library

Interview practice

Solve complete questions with progressive hints, worked solutions and Python implementations. Each question explains its assumptions and source match. Original interpretations are labelled explicitly.

752

Ready to practise

174

Not yet playable

926

Catalogue titles

Public standard problems and original exercises; hidden Trading Interview questions have not been verified.

174 titles have been investigated but remain unresolved. Their missing details are recorded without adding substitute exercises. Every playable question has a guided animated answer; selected questions also have custom diagrams.

Practise Learnr’s own questions →Follow a role-specific curriculum →

752 matching entries · page 1 of 16

Programming · Hard

Dijkstra's Algorithm #2

Original interpretation · Match confidence: medium

Company use unverified
About this question’s source match

Title-specific Learnr interpretation: The numbered sequel is deliberately practiced as an all-distances variant. Numbering alone does not verify what Trading Interview #2 adds. Private catalogue statement unavailable; the chosen contract is an original interpretation, not a verified original question.

Original Learnr interpretation; the private catalogue statement is unverified. Implement solve(graph,source) returning shortest directed distances from source to every vertex. graph[u] contains [v,weight] pairs. Return None for unreachable vertices and zero for source.

Assumptions and constraints

  • Vertices are labeled 0 through n-1.
  • Weights are nonnegative integers, including zero.
  • 1 <= n <= 100000; <= 500000 edges

Examples

graph=[[[1,3],[2,9]],[[2,2]],[],[]], source=0
→ [
  0,
  3,
  5,
  null
]

Node 2 is reached more cheaply through node 1; node 3 is isolated.

Company evidence · unverified

No company-specific source has been matched to this exercise. Its references support the topic or solution method; they do not establish employer use.

References

Read the supporting material without leaving your question.

Catalogue metadata captured 2026-10-12. Metadata source.