If the cost price of one mango is C, then 150C is the CP. If the SP is S then 150S is the total selling price. The profit is 150(S-C)=30C or 30S, depending on interpretation.
Assume it's 30C: 150S-150C=30C; 150S=180C. C=150S/180=5S/6. The profit is based on the CP, so the percentage profit is 30C*100/150C=20%.
Now assume it's 30S (the selling price): 150S-150C=30S; 120S=150C, so S=5/4C. The %ge profit is based on CP, so it's 30S*100/150C=30*5C*100/600C=25%. So it looks like the second interpretation, where the profit is based on the selling price of the mangoes, is the intended one.