This question evaluates a candidate's ability to manipulate relational data and reason about graph reciprocity, specifically testing SQL query formulation, aggregation, deduplication, and indexing for performance in the Data Manipulation (SQL/Python) domain.
You have a directed edge list that records who followed whom. A mutual “friendship” exists only if both directions appear (A→B and B→A). Schema and sample data:
Schema: FriendEdges(id INT PRIMARY KEY, user_from VARCHAR(10), user_to VARCHAR(10))
Sample rows: id | user_from | user_to 1 | A | B 2 | B | A 3 | A | C 4 | C | A 5 | A | D 6 | D | A 7 | B | C 8 | C | B
Tasks: