What are the differences between directed and undirected graphs? Give real-world examples of each.

Quick Overview

Explain how directed and undirected graphs differ and give real-world systems that fit each. Tests whether a relationship is symmetric, how direction changes degrees, connectivity, cycles and storage, and which algorithms apply to only one kind of graph.

What are the differences between directed and undirected graphs? Give real-world examples of each.

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: easy

Interview Round: Other

Explain the differences between a directed graph and an undirected graph. Provide examples of real-world scenarios for each. ```hint Swap the endpoints For each relationship you use as an example, ask whether it still holds when you swap the two things it connects. ``` ### What a Strong Answer Covers - What an edge means in each kind of graph, and what symmetry of the relationship implies - How direction changes degrees, reachability, connected components and cycles - How each kind of graph is usually stored - Real-world examples of each, with the reason the relationship is or is not symmetric - Algorithms or concepts that apply to only one of the two kinds ### Follow-up Questions - How would you model a city road network that has both two-way and one-way streets? - What is the difference between strongly and weakly connected components in a directed graph? - Why does PageRank need a directed graph? - What changes in cycle detection when you move from an undirected graph to a directed one?

Overview: Explain how directed and undirected graphs differ and give real-world systems that fit each. Tests whether a relationship is symmetric, how direction changes degrees, connectivity, cycles and storage, and which algorithms apply to only one kind of graph.

General logo
General
Nov 24, 2026
easySoftware EngineerOtherSoftware Engineering Fundamentals
0
0

Explain the differences between a directed graph and an undirected graph. Provide examples of real-world scenarios for each.

What a Strong Answer Covers Guidance

  • What an edge means in each kind of graph, and what symmetry of the relationship implies
  • How direction changes degrees, reachability, connected components and cycles
  • How each kind of graph is usually stored
  • Real-world examples of each, with the reason the relationship is or is not symmetric
  • Algorithms or concepts that apply to only one of the two kinds

Follow-up Questions Guidance

  • How would you model a city road network that has both two-way and one-way streets?
  • What is the difference between strongly and weakly connected components in a directed graph?
  • Why does PageRank need a directed graph?
  • What changes in cycle detection when you move from an undirected graph to a directed one?