A rock is thrown straight upward, reaching a height of

20 meters. On its way up, does the rock spend more time in
the top 5 meters of its flight than in the first 5 meters of its
flight?

No, the rock spends the same amount of time in the top 5 meters of its flight as in the first 5 meters of its flight. This is because the rock is accelerating at a constant rate due to gravity, so the time it takes to reach the top 5 meters is the same as the time it takes to reach the first 5 meters.