Section 151 of IPC provides
Whoever knowingly joins or continues in any assembly of five or more persons likely to cause a disturbance of the public peace, after such assembly has been lawfully commanded to disperse, shall be punished with imprisonment of either description for a term which may extend to six months, or with fine, or with both.
2) The object of Sections 107 and 151 is “preventive justice and not punitive. Section 151 should be invoked only when there is an imminent danger to peace or a likelihood of breach of peace under Section 107. An arrest under Section 151 can be supported when the person to be arrested designs to commit a cognisable offence. A further condition for the exercise of such power, which must also be fulfilled, is that the arrest should be made only if it appears to the police officer concerned that the commission of the offence cannot otherwise be prevented.”
3) you should mention your detention in filling application for govt jobs . It should not be obstacle for your civil career