WHAT kind of people live in this building?”

That is often the first question brokers are asked by apartment hunters — be they couples with children, retirees seeking peace and quiet or 20-somethings prone to the occasional raucous party.

But in recent months, thousands of brokers have learned that in answering that question, they might just be breaking the law. Many real estate ads, for instance, use “family friendly” to describe large apartments. But according to a strict interpretation of federal, state and local fair-housing laws, that is illegal.

“If a family with children wants to know if there are other children the same age in a building, we’re supposed to say, ‘You should stand outside the building between 2 and 5 p.m. and see who walks in,’ ” said Michele Kleier, the president of Gumley Haft Kleier. “But how do you say something like that with a straight face?”

A glance at real estate listings online reveals that there are still companies whose ads say things like “Best family building in New York,” but there are many more that in the interest of fairness or out of fear of a lawsuit have cleansed their ads and are retraining their brokers.