“The law is so inflexible,” said Judge Corriero, now executive director of Big Brothers Big Sisters of New York City and the author of “Judging Children as Children: A Proposal for a Juvenile Justice System.” The 2006 book calls for a justice system that reduces future crime rates by nurturing those who can learn from their mistakes, instead of turning them into career criminals.

Image From left, Mr. Wu’s mother, Floren Wu-Li; his sister Jenny Gong; and his fiancée, Anna Ng. Mr. Wu, 29, an executive who came here at age 5, faces deportation for muggings when he was 15. Credit... Todd Heisler/The New York Times

That was his aim, he said, when he presided over the special court known as the Manhattan Youth Part, his views shaped by his own childhood. The son of a longshoreman and a factory seamstress, he grew up in a tenement across the street from the Tombs — the Manhattan House of Detention — and was schooled by both Roman Catholic missionaries in Chinatown and the Mulberry Street Boys. While he avoided serious trouble, he saw how easily a careless choice could lead to culpability instead of accomplishment.

The neighborhood pressures were not so different decades later, when Mr. Wu hung out at video arcades while his mother worked long hours in a garment factory and his father cooked at Chinese restaurants out of state. A friend from that period recalls seeing a shoe print on the teenager’s back from a street beating. He looked to his pals for self-defense that turned predatory.

In December 1995, he and two other teenagers, one of them pretending to have a gun, took a jacket from a young boy. In two episodes in April 1996, he and others robbed elderly men of money, knocking one down and punching another; he took part in a fourth mugging that June, records show.

“I’m sorry and I really hope that you will forgive me for all the pain and trouble I made them go through,” the teenager said when he was sentenced.

The judge called the case a tragedy, according to the court transcript. “But this is not the end,” he told the youth, who had scored in the 98th percentile in mathematics. “This is really the beginning of a new period for you. I want you to educate yourself. Continue to read, follow the rules.”

“You will want to get a job and become a meaningful, constructive member of society to help your family,” he added. “I will be there to make sure that you can.”