Thoughtworks SDE Interview | Graph Theory (Strongly Connected Components) | Off-campus
Question · Posted Jun 2026
Question 1: Strongly Connected Components (Kosaraju's Algorithm) Problem Statement Given a Directed Graph with V vertices and E edges, find the total number of Strongly Connected Components (SCCs) in the graph. A Strongly Connected Component is a maximal portion of a directed graph where there is a valid path from every single vertex to every other vertex within that portion. Constraints 1 <= V <= 105 0 <= E <= 105 Example Input: V = 5, Edges = [[0,2], [2,1], ...
The full answer & interview discussion are available to premium members.
Log in Create a free account