“I think this fish has found her pond.”

That’s what Sonia Sotomayor told a friend after her first day in open court as a new federal judge back in 1992. She had been so terrified, she recalls in her new memoir, that her knees were literally knocking together as she began addressing the courtroom from the bench. And yet the minute she jumped in with a question for the litigants, the panic passed, and she realized she would be just fine.

More than fine, it turns out: from federal court for the Southern District of New York she would move on to the United States Court of Appeals for the Second Circuit, and in 2009 she was sworn in as an associate justice of the Supreme Court.

In nominating Judge Sotomayor to the highest court in the land, President Obama pointed out that her life story was the embodiment of the American dream. She grew up poor in a Bronx housing project at a time when gangs were carving up the neighborhood, learned she had juvenile diabetes when she was 7 and lost her father a couple of years later. She would go on to Princeton (where she won the prestigious Pyne Prize), Yale Law School, the Manhattan district attorney’s office and ultimately the Supreme Court, where she became the nation’s first Hispanic justice.

But if the outlines of Justice Sotomayor’s life are well known by now, her searching and emotionally intimate memoir, “My Beloved World,” nonetheless has the power to surprise and move the reader. Whereas the justice’s legal writings have been described by reporters as dry, methodical and technical, this account of her life is revealing, keenly observed and deeply felt.

The book sheds little new light on how she views issues that might come before the Supreme Court (aside from some candid talk about resistance she encountered, as a student, from critics of affirmative action), but it stands very much on its own — not unlike Barack Obama’s first book, “Dreams From My Father” — as a compelling and powerfully written memoir about identity and coming of age.

Through evocative, plain-spoken prose Justice Sotomayor engages in an earnest, soul-searching look back at her childhood as the daughter of Puerto Rican parents and at her education and years as a lawyer. She provides a visceral sense of what it was like to grow up with a dysfunctional family, overshadowed by her alcoholic father’s unpredictable behavior, and what it was like to grow up in the Bronx in the 1960s and ’70s, in a neighborhood where stairwells were to be avoided (because of muggers and addicts shooting up), and where tourniquets and glassine packets littered the sidewalks.

The young Sonia’s best friend was her cousin Nelson, with whom she began childhood “almost as twins, inseparable and, in our own eyes, virtually identical” — except that “he was smarter” and “had the father I wished for.” Nelson would become a heroin addict and die of AIDS before his 30th birthday. Why, Justice Sotomayor wonders, did she manage to survive when Nelson failed, “consumed by the same dangers that had surrounded me?”

The culture of machismo played a role, she writes, the “culture that pushes boys out onto the streets while protecting girls,” but her own force of will would prove crucial too.

That sense of discipline and perseverance stemmed partly from her determination to manage her diabetes (she started giving herself insulin shots at 7 because her parents seemed unable to deal with the procedure); partly from her awareness, as a child, of the precariousness of existence, slammed home by her father’s drinking and her mother’s angry response to his alcoholism (which took the form of working nights and weekends to avoid being at home). It was the love and protection of her grandmother Abuelita, says Justice Sotomayor, that gave her “a refuge from the chaos at home” and allowed her “to imagine the most improbable of possibilities for my life.”

The self-reliance she learned as a girl would serve her well in navigating the high altitudes of the Ivy League and later the world of law, but it would also have emotional fallout on her personal life. She says her marriage to her high school sweetheart, Kevin Noonan, fell apart partly because of the demands of her career, partly because her husband said he felt she did not really need him.

She didn’t think of “need as an essential part of love,” she says, but that was perhaps too rational a way of looking at it: “The truth is that since childhood I had cultivated an existential independence. It came from perceiving the adults around me as unreliable, and without it I felt I wouldn’t have survived. I cared deeply for everyone in my family, but in the end I depended on myself.”

As a girl, Sonia became fascinated with the idea of becoming a lawyer or judge from watching “Perry Mason.” Her first dream, however, was of growing up to become a detective like her favorite heroine, Nancy Drew. Her mind worked in similar ways to Nancy’s, she told herself:

“I was a keen observer and listener. I picked up on clues. I figured things out logically, and I enjoyed puzzles. I loved the clear, focused feeling that came when I concentrated on solving a problem and everything else faded out.” That rationality — and her sense of herself as “a creature of rules” — would prove useful in law school, and later when she was a prosecutor and judge.

“If the system is broken, my inclination is to fix it rather than to fight it,” she writes. “I have faith in the process of the law, and if it is carried out fairly, I can live with the results, whatever they may be. And knowing that the poor and minorities are disproportionately the victims of crimes, I’m loath to view the adversarial process of the law as class warfare by another name.”

Justice Sotomayor writes as someone with considerable self-knowledge, and she points out that there has been a recurrent pattern in her life. Whether it was Princeton, Yale Law, the Manhattan district attorney’s office or an appointment to the bench, the challenges of a new environment would initially lead to a period “of fevered insecurity, a reflexive terror that I’ll fall flat on my face,” followed by “ferocious compensatory effort.” She had learned from her mother, she says, that “a surplus of effort could overcome a deficit of confidence.”

In college she received a C on her first midterm paper and realized she needed to learn how to construct more coherent arguments, and that she also needed to improve her English, which was “riddled with Spanish constructions and usage.” Over the next few summers, she says, she devoted each day’s lunch hour to grammar exercises and to learning 10 new words. She also tried to catch up on the classics — like “The Adventures of Huckleberry Finn” and “Pride and Prejudice” — that she’d missed out on in her youth, when there was little to read around the house besides Reader’s Digest.

Fear of leaving anything to chance — another legacy of her unstable childhood — made her prepare intensively for classwork and legal cases. And her single-minded devotion to work paid off: just as she became adept at collecting gold stars as a schoolgirl, so she graduated from Princeton summa cum laude and, as a prosecutor, began racking up convictions. She credits her many mentors — including José A. Cabranes at Yale and Senator Daniel Patrick Moynihan, who helped set her career as a federal judge in motion — with teaching her fundamental lessons along the way, which, she says ,she absorbed as a “happy sponge.”

For instance, she notes that Warren Murray, the bureau chief in the Manhattan district attorney’s office, taught her that, as a prosecutor, she could not appeal to logic alone, but needed to use emotion to make jurors feel the “moral responsibility to convict.”

The state’s case “is a narrative: the story of a crime,” she goes on. And: “It is the particulars that make a story real. In examining witnesses, I learned to ask general questions so as to elicit details with powerful sensory associations: the colors, the sounds, the smells that lodge an image in the mind and put the listener in the burning house.”

This insightful memoir underscores just how well Justice Sotomayor mastered the art of narrative. It’s an eloquent and affecting testament to the triumph of brains and hard work over circumstance, of a childhood dream realized through extraordinary will and dedication.