The six-story walk-up at 339 East 94th Street has seen much over the decades: generations of mostly white and Hispanic immigrants, nests of mice, drug deals, a police bust, at least one stabbing, a recent influx of young professionals, and a future presidential candidate: Barack Obama.

In his memoir, “Dreams From My Father” (Three Rivers Press, 1995), Mr. Obama described his Yorkville apartment, on East 94th Street between First and Second Avenues, as “part of the shifting border between East Harlem and the rest of Manhattan.” He described a scene that will sound familiar to undergraduates and others who scraped by in the seedy and dangerous New York of the 1980s:

It was an uninviting block, treeless and barren, lined with soot-colored walk-ups that cast heavy shadows for the rest of the day. The apartment was small, with slanting floors and irregular heat and a buzzer downstairs that didn’t work, so that visitors had to call ahead from a pay phone at the corner gas station, where a black Doberman the size of a wolf paced through the night in vigilant patrol, its jaws clamped around an empty beer bottle.

He said that he would chat with Puerto Rican neighbors and stop to talk to the boys on the stoop about the Knicks or the gunshots heard the night before. An old neighbor died on the third floor landing with $1,000 in small bills rolled up in his refrigerator. Mr. Obama was living in the building when he received a phone call about his father’s death from a car accident in 1982.

While no residents, current or past, who were contacted by The Times remembered Mr. Obama, they shared tales of a building with low rents and dicey circumstances during the early 1980s, when Mr. Obama apparently lived there, before and after he graduated from Columbia University in 1983. (“B. Obama” was listed in telephone directories at 339 East 94th Street in the early 1980s. Mr. Obama did not specify the building number in his memoir, and his campaign has said that he has forgotten specifics of his youth.)

Frank Neubauer, 73, who has lived all his life in the building except for two years in Brooklyn, confirmed Mr. Obama’s account that it was a rough place back then. “They had a lot of drug users in the building, everybody knew it,” he said. (Three generations of his family have lived in the building, including his son, who now lives on the same floor.) “Nobody paid any attention. People knew it was going on and that was it, and eventually the cops came and cleaned up the building.”

Violent crime was also rampant. “I had a gun put to my head in the lobby,” said David W. Burns, who lived in the building for two years in the early 1980s. “It was pretty late, 3 a.m. in the morning, I passed this guy on the street, but for some reason I forgot about him,” he said. “He just followed me into the vestibule. Between two doors you’re pretty vulnerable.” The man took only his money. “Thank God.”

Another resident was stabbed in the hall one evening by people who followed him home from the supermarket. “It was just in his thigh,” Mr. Burns recalled. “He was lucky.”

The landlord in the early 1980s was Jay Weiss, a real estate mogul who was then the husband of the actress Kathleen Turner. Mr. Burns, who now works in the media industry and lives in Wilton, Conn., said Mr. Weiss left behind hard feelings, because the building often had no heat and the front door was often unlocked. Mr. Burns went after Mr. Weiss for overcharging for rent-stabilized apartments, eventually winning a judgment.

“I actually used that money to pay for business school,” Mr. Burns said.

When Mr. Neubauer was a child before World War II, the building was occupied by predominantly Austrian immigrant families with some Hungarians and German thrown in. “Back then everybody knew everybody in the building,” he said.

As those families moved out, the inexpensive but relatively spacious apartments enticed working-class immigrant families, students and young professionals who needed cheap apartments in New York City. (Mr. Burns and his wife, both struggling artists, paid $450 for a two-bedroom apartment.) The building was a solution, he said, for “when you are just getting out of college and you have no money, and you want to live in Manhattan.”

These days, the upper reaches of Yorkville have changed — in ways that might have been unthinkable to New Yorkers of earlier eras. Luxury high rises have sprouted up. The 94th Street building has become home to a more professional crowd.

“When someone moves out or passes away, they renovate the apartment and charge market rates, so now you have a predominantly yuppie crowd,” Mr. Neubauer said.

(That probably explains why few of them were home during the day when City Room went knocking door to door, though they did leave many barking dogs behind — one apartment had a dog-sitter.)

Mr. Neubauer says he is a political independent, so he cannot vote for his former neighbor on Tuesday. “I have to find out who is going to win the primary. Then I will concentrate more on who I am going to vote for,” he said.

As for Mr. Obama? “I like him. I think he’s very intelligent. He’s different. He’s fresh. Maybe that is what we need.”

Among those who live in one of the renovated apartments, with their hardwood floors and white wooden cupboards, was Jasmine Correa, 28, who moved into the neighborhood three years ago, in part because of the high quality of the neighborhood’s public schools.

She was surprised, she said, by how much the landlord, Faith Ministries, had raised the rent in the last year for a ground-floor studio, to just around $1,500 a month from around $1,100.

“This building was really bad back then,” Ms. Correa had heard. “It’s amazing that a leader used to live here in this building.”

But her political sympathies lie elsewhere: She said her preferred candidate is Ron Paul.

Jodi Kantor contributed reporting. Read more Primary Journal blog entries from the New York region.