A judge in Manhattan Friday suggested that the police may be using “random, unjustified” questioning of people they encounter in public housing buildings in their zeal to use the trespass laws to curb crime in the city’s 334 housing projects.

Acting Justice Analisa Torres (See Profile) ruled that police officers conducting “vertical patrols” cannot routinely question without a reason residents and visitors to establish that they are legitimately on Housing Authority property.