Indira Hector imagined leaving New Jersey for Paris or London after her husband died five years ago but she never thought she’d move to Gaithersburg, Md.

When a pharmaceutical industry recruiter contacted her through LinkedIn last fall, she decided to explore the opportunity.

While interviewing with AstraZeneca, Hector said she realized she knew many of the people from her days at Merck, piquing her interest in the regional human resources director position.

Once she got the offer with a relocation package, things began moving fast. Knowing she was on her own, Hector accepted the opportunity. Her son had left for the Rhode Island School of Design, and her daughter had graduated from the University of Pennsylvania and was living in California. In December, Hector was off to Gaithersburg, about a 30-minute drive from Washington.

Relocating from one place to another, whether near or far, typically means buying and selling homes at the same time or nearly so. And while that may seem straightforward, it can be one of the most stressful situations a person can face. Even an organized person who works with a knowledgeable real estate agent can be overwhelmed.

“There’s a lot of change at once,” said Susan Sonnesyn Brooks, a real estate agent with Weichert Realtors. “And a lot of money involved. You really have to be organized.”

Hector, 51, decided to commute weekly to her new job, and take her time finding a new home near the Gaithersburg office. But even the best-laid plans can go awry. Hector began staying in Airbnbs Sunday through Thursday nights, then drove back to New Jersey Friday after work.

The commute took three hours on Sundays, yet up to five hours on Interstate 95 after work on Fridays.

On weekends in New Jersey during January and February, Hector readied her three-bedroom, 1 1 / 2 -bath townhouse for sale. She had accumulated a lot during 15 years there. When she put the place on the market in February, she got three offers in one day. “It looked almost brand new,” she said.

She’d planned to wait until March or April to look for a new home, but began searching online in February and found one in Gaithersburg that changed her mind. She met with Brooks at the house one Sunday in February. “As soon as I walked in I fell in love with it,” Hector said of the five-bedroom, 3½ -bath house. She made an offer for the asking price of $680,000, and the owners accepted it. Hector intended to use the equity from the sale of her townhouse for the down payment.

She was set, or so it seemed.

Then, the unexpected happened. The coronavirus pandemic hit, and the buyer in New Jersey backed out of the deal. Luckily, Hector had the mortgage secured on the Gaithersburg property, and managed to obtain a lease for the New Jersey house. Then, the renter’s job offer in New Jersey fell through, and decided not to leave Colorado.

Hector had neither a buyer nor a lease for her New Jersey townhouse. “I used my own cash deposit instead of waiting for the money from the sale,” she said. She closed on the house in Gaithersburg, and told the owners they could stay in the house until April 15 at no cost.

The pandemic was raging, and Hector had begun to wonder: “Who knows if the banks are going to stop lending money?” She was happy to have found and signed a contract on her dream house.

The thought of carrying two mortgages was unsettling, but luckily, her relocation package included 90 days of housing expenses toward whichever house cost less; the package covered interest, insurance and utilities but not principal on the mortgage in New Jersey. Still, it bought her time to get the townhouse back on the market, and a cushion “if it took a long time to sell,” she said.

Meanwhile, Hector moved into her new home in late April, and put the townhouse back on the market for sale in May. This time, there were three offers in one day, one above the asking price. In the end, she sold the townhouse for $310,000, and bought the Gaithersburg place for $680,000, under her budget of no more than $750,000.

What did Hector learn about buying and selling at the same time?

“It’s hard to plan,” she said. “The stress is a lot more than you think it’s going to be. You never know how things can change. You can’t think it’s ever going to unfold the way you think it’s going to.”

The timing of buying and selling doesn’t always work as you anticipate it will.

“I was hoping everything would work in concert perfectly,” Hector said. She thought her townhouse in New Jersey would be on the market for two months, giving her time to find a house in Gaithersburg.

Yet the twists and turns ended up being a “blessing in disguise,” Hector said. For example, when the lease fell through she was able to get a buyer, and not have to be a landlord for the New Jersey place she really wanted to sell.

Every situation is different. Consider Kenneth and Betty Beam who wanted to trade their Chevy Chase, Md., colonial near Western Avenue on a corner lot for a smaller space. The first thing they needed to do was to find a place to move within the Washington area, then sell the single-family house they had lived in for 39 years. “The hardest part was finding the new place,” said Kenneth, 77, a retired association executive. “We concentrated on that.” They were able to buy a new home with cash from savings, then sell their home.

Yet finding a place and winning it in a bidding war wasn’t easy. “We tried for seven or eight places,” inside the Beltway, bidding on condominium units for $800,000 to $900,000. “We got outbid,” he said, even when bidding $50,000 over the asking price. “And we weren’t even close.”

This occurred over a period of a couple years, until they got serious about finding a place about a year ago. “I looked every night on Zillow to see what was coming up,” he said. “They’re gone in a day or two days.”

One night he saw a three-bedroom, 2½ -bath condominium unit in a low-rise building in Leisure World in Silver Spring, Md., set against woods where foxes and deer run in March. “It’s a nice big unit,” Beam said. They went to see it, and made a bid on it that day for an all-cash deal. One of the appeals was that an outdoor 1,500-square-foot patio almost doubled their living space.

“I can’t imagine selling my house, and then trying to look,” he said.

Priorities and timing

In fact, real estate agents and other experts often advise finding what you want first when buying and selling. You won’t feel rushed to find a home that you like, or end up buying something that doesn’t meet your needs and wants.

“It’s always preferable to go shopping, buy something, get comfortable and then sell at your leisure,” said Billy Buck, owner of Billy Buck & Associates in Arlington, Va. But that’s not always possible. Many people are dependent on the profit from the sale of their current home for a down payment on the next one. If you have extra cash for the down payment on the new place — then you can buy first. “If you have the flexibility to buy a house first you have more options,” Buck said. “If buying a new home is contingent on the sale of your current home, in a runoff, you’re going to lose. If there are three buyers to choose from, all else being equal, sellers are going to go with the buyer who does not need to sell his house first.”

Even if you don’t actually sign a contract and close on a new home first because you cannot qualify to carry two homes at same time, you can scope out neighborhoods, first online, then in person. Decide what is important to you in a neighborhood, then evaluate properties you view online for those criteria. Ideally, if you can afford to carry both properties while the sale of both properties close, it can be easier. “Not a lot of people can do that so it becomes a big issue,” said Joe Freeman, a real estate agent with McWilliams/Ballard in Washington.

If the market is moving fast — homes sell quickly and may have several offers in the first day on the market — you have to be especially careful.

You can put your house on the market, and have multiple offers within a couple of days, said Nancy Pav, a real estate agent with Century 21 in Ashburn, Va. If you haven’t found your new home yet, renting in the transition can be an option. People often want to avoid two moves or having to store their possessions.

In the Washington area, homes tend to sell quickly, even during the pandemic. “It’s a very fast market,” said Brooks. “There is so little supply. If you put your house on the market it sells quickly, you’re not going to have a place to live.”

How to buy and sell homes simultaneously

Unless you are a first-time home buyer, you are likely to be buying and selling at the same time. Here’s what you need to do:

● Get your current home ready for sale: declutter, make needed repairs and renovations.

● Look for a new home online first to familiarize yourself with neighborhoods and homes that meet your needs and wants.

● If you can’t carry two mortgages at once, find your new home, and request a longer settlement period, the time between the accepted offer and the closing. Rather than the typical 30 to 45 days, aim for 60 days or longer to sell your current home. Lenders determine, based on your income, assets and liabilities, whether you qualify to carry two homes at once.

● If necessary, sign a post-settlement occupancy agreement that allows you to occupy the home you are selling, for example, for 30 days until you close on your new home.

● Borrow money from friends or family for a down payment until your current home closes or apply for a home equity loan on your current home or a bridge loan from a bank. Home equity loans can take time to obtain.