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
Statistics & Math
Software Engineer
Meta
November 29, 2026
Software Engineer
Phone Screen
Statistics & Math
Easy

0

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
Handshaking lemma
Degree sequences
Regular graphs
Parity arguments
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. 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 Questions
Sample 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 ∑vdeg⁡(v)=2∣E∣\sum_v \deg(v)=2|E|, which must be even....


Submit Your Answer
Markdown supported