Complete the code to identify the main data structure used for storing user connections in a social graph.
The social graph is typically stored as a [1] where nodes represent users and edges represent connections.
The social graph is best represented as a graph data structure because it naturally models users (nodes) and their connections (edges).
Complete the code to describe the storage method for a social graph with millions of users.
For scalability, social graphs are often stored in a [1] database that supports relationships efficiently.
Graph databases are designed to efficiently store and query relationships, making them ideal for large social graphs.
Fix the error in describing how to represent user connections in adjacency form.
An adjacency list stores connections as a dictionary where keys are user IDs and values are lists of [1] user IDs.
Adjacency lists store the IDs of users directly connected to each user, so the correct term is connected user IDs.
Fill both blanks to complete the description of a common query on social graphs.
To find mutual friends between two users, we compute the intersection of their [1] lists and then filter by [2].
We find mutual friends by intersecting the connections lists of two users and then filtering by active status to ensure relevance.
Fill all three blanks to complete the code snippet for storing social graph data efficiently.
storage = [1].partition_by([2]).replicate([3])
Graph databases (graph_db) partition data by user_id for load balancing and replicate data 3 times for fault tolerance.
