When do the sizes of conjugacy classes and squares of degrees of irreps give the same partition for a finite group? I should admit the question below does not have a serious motivation. But still I found it somehow natural.
Let $G$ be a finite group of order $n$ with $h$ conjugacy classes. If $c_1,\ldots,c_h$ are the orders of the conjugacy classes of $G$, then clearly
$n=c_1+c_2+\ldots+c_h$.
Let now $\pi_1,\ldots,\pi_h$ be the pairwise non-isomorphic, irreducible complex representations of $G$. It is well known that another partition of $n$ of length $h$ is given by the squares of the degrees $d_i$'s of the $\pi_i$'s:
$n=d_1^2+d_2^2+\ldots+d_h^2$.
Question: Assume that, up to reordering, the two partitions of $n$ described above are the same. Then what can we say about $G$? Is $G$ forced to be abelian?
 A: This is not an answer, but more of an extended comment. It seems that the first one to raise this question was E. Bannai Association schemes and fusion algebras. (An introduction), J. Algebr. Comb. 2, No. 4, 327-344 (1993). The motivation was to find examples of when a certain matrix attached to a group association scheme is unitary (which is the case for "naturally occuring" association schemes). This happens precisely when the irreducible characters and conjugacy classes of the finite group can be paired up such that the size of the conjugacy class is the square of the corresponding character degree.
On p. 341 Bannai mentions that M. Kiyota has proved (using the CFSG) that this property does not hold for any non-abelian simple group. This shouldn't be too hard; as Jim Humphreys has noted, the case of simple groups of Lie type follows from the existence of the Steinberg character, whose degree equals the order a Sylow $p$-subgroup, hence the square of its degree cannot divide the order of the group. For simple alternating groups, it is easy to find conjugacy classes which are not squares, and for the sporadic groups one can explicitly check whether the condition holds in each case.
Bannai also mentions that Kiyota "conjectures that $G$ must be nilpotent if the condition is satisfied", so Kevin Buzzard's question has been asked before.
An interesting development that gives some support to the conjecture that these groups are nilpotent is this paper:
Andrus, Ivan; Hegedűs, Pál; Okuyama, Tetsuro, Transposable character tables and group duality., Math. Proc. Camb. Philos. Soc. 157, No. 1, 31-44 (2014). ZBL1330.20007,
where it is shown that every transposable group is nilpotent. Transposable groups are finite groups $G$ whose character table has the property that its transpose (viewed as a matrix) is, up to multiplication by suitable diagonal integer matrices on each side, equal to the character table of some other finite group $G^T$. Moreover, $G$ is called self-dual if it is isomorphic to $G^T$ (there are other, equivalent, definitions). By definition, self-dual groups satisfy the condition that conjugacy class sizes are the squares of corresponding character degrees (i.e., that the two partitions in the OP agree). Thus, at least self-dual groups are nilpotent. However, I think there exist non-self-dual groups satisfying the condition that the two partitions agree, so in general Kiyota's conjecture seems to be open.
A: My standard rant about "what can we say about $G$": what we can say about $G$ is that the two partitions are the same. If the questioner doesn't find that a helpful answer then they might want to consider the possibility that they asked the wrong question ;-)
But as to the actual question: "is $G$ forced to be abelian?", the answer is no, and I discovered this by simply looping through magma's database of finite groups. Assuming I didn't make a computational slip, the smallest counterexample has order 64, is the 73rd group of order 64 in magma's database, which has 8 representations of degree 1, 14 representations of degree 2, 8 elements in the centre and 14 more conj classes each of order 4.
Letting the loop go further, I see counterexamples of size 64, 128, 192 (I guess these are just the counterexamples of size 64 multiplied by Z/3Z) and then ones of order 243 (a power of 3). So I guess all examples I know are nilpotent. Are they all nilpotent? That's a question I don't know the answer to.
A: @Marty Isaacs: There exist non-nilpotent groups whose conjugacy class sizes are all squares. For example, let $G$ be Magma's 93rd group order 540. It has class sizes 1,4,9. Indeed, |G|=15*1+30*4+45*9. Also $|Z(G)|=15$ and $G/Z(G)$ is centerless. Thus G is non-nilpotent, and
each conjugacy class size is a square.
