Trouble began early in the life of Alexander Williams, the son of a city correction officer from Brownsville, Brooklyn. His first arrest came at age 11. When he was 14, a close cousin was stabbed to death with a barbecue fork outside the Williams family home.

Serious charges started piling up: four arrests on weapons charges, and in April, a charge of attempted murder. The next month, he was shot in the shoulder. Days later, officers arrested him outside a baby shower and charged him with possession of a .25-caliber handgun.

In the eyes of police leaders, a small number of teenagers and young men — often familiar faces to police officers on the street — are behind the rise in shootings in New York City over the last two years. They are also frequently the victims of gun violence.

The life of Mr. Williams, now 19 and indicted by a grand jury on the most recent gun charge, is emblematic of that perspective. But his experiences also represent some of the tensions that have surfaced: the difference between what police officers and detectives believe they know and what can be proved in court; the challenge presented by focusing enforcement on the most hardened young people; and questions raised by numerous arrests that do not result in convictions.