Example 5 Suppose among $n$ freshmen, any 3 people have 2 people who know each other, and any 4 people have 2 people who do not know each other. Try to find the maximum value of $n$.


Solution: The maximum value of $n$ is 8.
When $n=8$, the example shown in the figure satisfies the requirements,
where $A_{1}, A_{2}, \cdots A_{8}$ represent 8 students,
and a line connecting $A_{i}$ and $A_{j}$ indicates that $A_{i}$ and $A_{j}$ know each other.
Next, assuming $n$ students meet the requirements, we will prove that $n \leqslant 8$. For this, we first prove that the following two cases are impossible:
(1) If a person $A$ knows at least 6 people, denoted as $B_{1}$, $\cdots, B_{6}$, by Ramsey's theorem, among these 6 people, there exist 3 people who do not know each other (which contradicts the given condition that any 3 people have 2 who know each other); or there exist 3 people who all know each other, in which case $A$ and these 3 people form a group of 4 who all know each other, contradicting the given condition.
(2) If a person $A$ knows at most $n-5$ people, then at least 4 people do not know $A$, and thus these 4 people all know each other, which is a contradiction.

Secondly, when $n \geqslant 10$, either (1) or (2) must occur, so $n$ does not meet the requirements at this time.

When $n=9$, to ensure that (1) and (2) do not occur, each person must know exactly 5 other people. In this case, the number of friend pairs (pairs of people who know each other) among the 9 people is $\frac{9 \times 5}{2} \notin \mathbf{N}^{*}$, which is a contradiction!

From the above, we know that the $n$ that meets the requirements is $\leqslant 8$. In summary, the maximum value of $n$ is 8.