Can Every User in a Seven Person Group Have Exactly Three Friends
Last updated: November 29, 2026
Quick Overview
A test fixture for a Facebook graph feature needs 7 users where every user has exactly 3 friends within the group. Prove whether such a friendship graph exists, and say which group sizes from 4 to 8 make it possible.
Meta
November 29, 20260
0
0 solved
A test fixture for a Facebook graph feature needs 7 users where every user has exactly 3 friends within the group. Prove whether such a friendship graph exists, and say which group sizes from 4 to 8 make it possible.
Meta engineers build synthetic social graphs for tests and load generation, and this warm-up checks a basic graph counting argument. The interviewer looks for the handshaking lemma and a constructive example where it is possible.
What the Interviewer Expects
- Applies the handshaking lemma: sum of degrees equals twice the edges
- Shows 7 x 3 = 21 is odd so no graph exists
- Constructs a 3-regular graph for even sizes
- Notes the extra requirement n > 3
- Connects to fixture or generator code
Key Topics to Cover
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
- Can 8 users each have exactly 3 friends? Give a construction.
- Can a group have exactly one user with an odd number of friends?
- How would you generate a random d-regular graph for testing?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Browse Statistics QuestionsSample Answer
Clarify
Friendships are undirected, no self-friendship, at most one edge per pair. Each of the 7 users must have degree exactly 3 inside the group....
Approach
Count friendship endpoints two ways. Every edge contributes exactly 2 to the sum of degrees, so , which must be even....