PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Citi

Implement bidirectional Dijkstra for shortest paths

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in graph algorithms and algorithm engineering, specifically understanding and implementing bidirectional shortest-path search with appropriate data structures, termination conditions, path reconstruction, and time/space complexity analysis.

  • Medium
  • Citi
  • Coding & Algorithms
  • Software Engineer

Implement bidirectional Dijkstra for shortest paths

Company: Citi

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

Given a directed or undirected graph with non‑negative edge weights, design and implement bidirectional Dijkstra (“double Dijkstra”) to find the shortest path between a single source s and target t. Specify the data structures for the forward and reverse searches, the termination condition, how to compute the correct shortest distance when the frontiers meet, and how to reconstruct the full path. Analyze time and space complexity versus standard Dijkstra, and discuss edge cases such as disconnected graphs and multiple shortest paths.

Quick Answer: This question evaluates proficiency in graph algorithms and algorithm engineering, specifically understanding and implementing bidirectional shortest-path search with appropriate data structures, termination conditions, path reconstruction, and time/space complexity analysis.

Related Interview Questions

  • Explain data structure fundamentals - Citi (Medium)
Citi logo
Citi
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
2
0

Given a directed or undirected graph with non‑negative edge weights, design and implement bidirectional Dijkstra (“double Dijkstra”) to find the shortest path between a single source s and target t. Specify the data structures for the forward and reverse searches, the termination condition, how to compute the correct shortest distance when the frontiers meet, and how to reconstruct the full path. Analyze time and space complexity versus standard Dijkstra, and discuss edge cases such as disconnected graphs and multiple shortest paths.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Citi•More Software Engineer•Citi Software Engineer•Citi Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.