Your real estate agent is supposed to represent your best interests, right? If you’re selling a home, your agent’s job is to earn you the highest sales price. If you’re buying, your agent’s priority should be to get you into your new home for the lowest price.

That’s how it’s supposed to work. But if you’re not careful, and if you don’t ask the right questions, you might end up with an agent who’s working not just for you, but also for the buyer or seller you’re negotiating with. That’s because of something called dual agency, and it’s a situation that could leave you without an agent who’s truly fighting for your interests.

And dual agency isn’t the only possible pitfall you might encounter with an agent. Some agents are simply better at fighting for their clients than others. The best agents are as concerned with getting the best deals for their clients as they are about earning the highest commissions.

That’s especially important today: With mortgage rates rising, buying a home is more expensive. It’s important, then, for buyers to purchase them for the lowest prices and sellers, who usually must buy a home after selling, to move theirs for the highest.

When searching for a home, you’ll need to work with plenty of professionals, everyone from mortgage lenders to home inspectors. Your real estate agent, though, might be the key to saving the most money when buying a home or earning the most when selling. Before signing a contract with a real estate agent, then, be sure to ask these key questions. It’s the best way to determine if an agent will place your interests first.

Who are they representing?

It's important to know who your agent is representing. You want your agent to work only for you. If you're a buyer, that means you want to work with a buyer's agent who will negotiate to find you the best house at the lowest price. If you're a seller, you want to work with a listing agent who will fight to get you the highest price for your home.

What you don't want is to fall into a dual-agency situation. That's when an agent represents both the seller and the agent in a single transaction. How can an agent represent your best interest as the seller if that same agent is also trying to earn the highest price on behalf of the seller? And on the opposite end, will your agent fight to lower the sales price of a home if that agent is also representing the home’s sellers?

Candice Williams, a real estate agent with RE/MAX Space Center in League City, Texas, said dual agency is never a good idea for consumers.

"Buyers should never work with the seller's agent because the seller's agent has a fiduciary duty to look out for the best interest of the seller, which naturally opposes the best interest of the buyer," Williams said.

If you're a buyer, then, ask for an agent who only works with buyers. This way, you won't run into a situation where you find a house you love only to discover that the agent representing its seller is the same one working with you.

It’s natural for agents to work harder for sellers than it is for buyers. After all, if you buy a home for a higher price, the agent will earn a higher commission. In a dual-agency situation, then, agents will be tempted to favor sellers.

The more you spend on a home upfront, the more difficult it will be to build up the equity you need to take out home equity loans that can help you cover the costs of your children’s college education, fund a kitchen remodel or pay off high-interest-rate credit card debt. That’s why working with an agent who will fight for the lowest price on your home is so important.

Dual agency is such a bad deal, usually for buyers, that eight states have made it illegal: Alaska, Colorado, Florida, Kansas, Maryland, Oklahoma, Texas and Vermont.

"A seller's broker's priority is to sell the home and do so at the highest price. This presents an inherent conflict of interest," said Mihal Gartenberg, a real estate agent with New York City-based Warburg Realty. "A buyer's broker is indispensable to a buyer as they can guide and advise the buyer to the right home, assess the true value of the home and negotiate without any conflict on their buyer's behalf."

What results do they get?

Real estate agents are ultimately measured by their results. But it’s not only about how many homes they sell each year or how many buyers they help find homes. If you’re selling, you want to know if agents sell homes close to their listing prices. You also want to know how long it takes agents to sell a home on average.

If you’re buying, you want to know if agents routinely persuade sellers to lower their asking prices.

It's not just about price

Top agents will work to get their sellers the best price on their home listing. And they'll work to lower the prices that their buyer clients pay. But the best agents don't focus solely on price during the negotiation process. They also negotiate favorable closing dates, fight for needed repairs on a home that's being sold and advocate for their clients over what stays in a home after it's sold and what goes.

If you absolutely want that swing set in the backyard to stay after you buy a house or if you can't move out of your home for another month, you'll need an agent who's willing to fight for those needs, too, said Jennifer Vaught, a real estate agent in the St. John, Indiana, office of Rossi & Taylor Realty Group.

"Many buyers think there's only one negotiating point, price. Wrong!" Vaught said. "There are actually more than seven standard terms that I regularly use to negotiate. Often, this gives sellers a lot more to think about than just the price."

Ask the agents you are considering how successful they’ve been in negotiating other concessions, anything from changing closing dates to negotiating repairs on outdated electrical or plumbing systems.

They research the market

As a buyer, you don't want to overspend on your next home. As a seller, you don't want to sell your property for anything less than the highest possible price.

That's why it's important to work with a real estate agent who understands your individual market. This agent will know when a home is priced fairly or when it's overpriced. This agent will also identity offers on a home that are too low.

Amanda Bolton, a real estate agent with the Las Vegas office of Platinum Real Estate Professionals, said that good agents know individual markets and their inventory of homes for sale like the "back of their hand."

"When I can't sleep at night, I often find myself studying the inventory available for my buyers," Bolton said. "A good buyer's agent will eat and sleep and breathe real estate and knows how to spot a gem and knows how to spot a deal."

Ask potential agents how long they’ve worked in the market in which you want to buy or, if you’re a seller, the neighborhood in which you currently live. Ask them how many homes they’ve sold in this market or how many buyers they’ve helped purchase in it. You want to work with an agent familiar with the market in the specific neighborhoods in which you are buying or selling.