What is the degree of a node in a graph, and how is it calculated?
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: easy
Interview Round: Other
Overview: Define the degree of a vertex in undirected and directed graphs and explain how to compute it from common graph representations. Tests in-degree and out-degree, special cases such as self-loops, the link between degrees and edge count, and where degrees show up in graph algorithms.