Calculate the rates at which users get stuck at each stage
you should define float failureRate = 0; inside the for (int i = 1; i &lt;= N; ++i) loop, because you are not using it outside the loop. See this for more info.
When you calculate failureRate, just cast one of usersOnStage.get(i) or total to float. You don't need to cast both.
else {failureRate = 0 / total;} is redundant because you'll always set failureRate to 0, which is its default value.


As for optimization to make it faster, since this piece of code is likely to be used in a video game, stages should be a small list, where efficiency of the algorithm doesn't matter much. You'd probably want to use simpler data structures, for a smaller overhead.