“That was something unexpected that you wouldn’t think of having in New York,” said Ms. Lopez, who anticipated the fun of having friends over in the summer.

She loved the apartment — which later sold for $160,000 — but had no idea how to go about buying it. So she called her bank to ask about mortgages, and was advised to take a class for first-time home buyers. Online, she found one that cost $100, run by the nonprofit Housing Partnership Development Corporation.

“I think I was the youngest there,” Ms. Lopez said.

Several months later, with the help of the teacher, Emily C. McIntosh, Ms. Lopez settled on a budget of no more than $200,000 for a studio or one-bedroom in a co-op building, preferably close to the subway and to her family in Elmhurst.

Housing prices in New York City, though, were a deterrent. Dreaming of warm weather, she considered moving to Southern California.