Now, as a police constable, she goes into schools to advise youngsters on their own personal safety.
As the Metropolitan Police's Schools Involvement Officer for the Wandsworth division she also advises black and Asian youngsters on how they should respond when being stopped and searched by her colleagues.
In a city where blacks and Asians are four times more likely to be stopped than whites, it is a thorny issue. Constable Hanif accepts that there will be times when the searching is unwarranted.
She said: "I tell them to stay calm - to take in all the information with their eyes and ears and not to become aggressive. If they have a complaint, they should take it to the station."
Constable Hanif, who is half Spanish and half Pakistani, is convinced that her own experiences of racism have helped her to have a better understanding of similar problems faced by today's youngsters.
After 11 years in the Metropolitan Police, she has learnt to take in her stride the "everyday" incidents of racism that she still experiences.
When she was transferred from a position on the Vice Squad to her current division, she was informed that colleagues had been wary of working with her because she was both female and Asian. They had been pleasantly surprised, she was told, by the professionalism she had shown.
Her conclusion is that she has to work harder than white officers to reach the same level of acceptance. "Because you are a high-profile Asian officer, if you make a mistake everybody talks about it" she said.
Reaction to her by the public has been mostly positive, although one Asian group complained that her father had failed in his duty by allowing her to become a police officer. But Constable Hanif, 35, pointed out: "The positive side of being a visible minority is that the public think you are going to play fair."
Since the Stephen Lawrence inquiry, she has noticed the change in atmosphere within police ranks with some white officers going out of their way to express solidarity with her.
Although racism has not gone away, she said: "I still feel safer raising these issues in the police canteen than in many of the other places I have worked."