Selecting optimal order of questions to minimize total time
Counterexample: Students are $x_1\dots x_n$ and $y_1\dots y_m$ and questions are $Q_0, \dots Q_m$. Students $x_i$ only want $Q_0$ to be answered while the $y_i$ students want question $Q_1,\dots, Q_m$ to be answered.

Let's say you place $Q_0$ as the $k^{th}$ question. Then the total time waited by students is:


$L(n,m)=n(m+1)+m^2$ if $Q_0$ is last
$nk + m(m+1)$ if $Q_0$ is $k^{th}$


Clearly, if you want to not put $Q_0$ last, then you might as well put it first so that the cost is $F(n,m)=n + m(m+1)$.

Now $L(n,m)-F(n,m)=nm+n+mm-n-mm-m=nm-m=(n-1)m$ so that whenever $n&gt;1$ and $m&gt;0$, we'll have $L(n,m)&gt;F(n,m)$. So placing it first is better.

But your greedy algorithm would put it last if we take $m&gt;n$.