When QuesTech Inc. went public last May, it didn't get what it bargained for.

The 16-year-old defense contracting firm, based in McLean, originally had planned to raise $6.5 million by selling 500,000 shares of stock at between $11 and $13 a share, according to a preliminary prospectus. But one of the company's underwriters, Legg Mason Wood Walker Inc., backed out of the deal. The company wound up selling only 255,000 shares at $8.50 a share, an asking price considered more reasonable by its other principal underwriter, Ferris & Co., QuesTech pulled in barely $2 million.

The public wasn't more receptive, because of poor market conditions for new stock offerings last spring and because the company is a defense contractor, according to Norman Fosback, editor of New Issues, an investment newsletter.

"Investors generally assign lower prices to defense-type companies because of the erratic nature of the business with large contracts," he said. "This company, at the time it was going public, did not show a particularly strong order backlog, casting some doubt on their ability to sustain their previous revenue growth."

Finally, Fosback said, the company took a big jump in profits in 1983 that was "completely out of character" given the company's previous record, and "investors may have been suspicious that such a profit rate could not be maintained."

One trouble with QuesTech, according to Ferris & Co., is that while some of its subsidiaries engage in various unclassified business, the government contracts that are the company's bread-and-butter are top secret and cannot be discussed with outside investors evaluating the company.

"When you are trying to market an issue and the company is involved in command-and-control and electronic warfare jamming radar signals to evade detection , it's very hard to sell it because the buyer doesn't understand what they do," said Jack Lowden, assistant vice president in corporate finance at Ferris & Co. The stock is now trading at about $7, he said, because of a combination of market forces, high interest rates and the economy.

As to why QuesTech's other underwriter backed out of the deal, "the initial public offering market was very weak," said Douglas Petty, vice president of Legg Mason Walker Wood. "The high-tech and defense stocks were off . . . but we were very high on QuesTech."

QuesTech President Herbert W. Klotz describes his company's classified work as "security matters." Simply put, QuesTech's approximately 500 employes "are involved in the collection and analysis of intelligence in a tactical combat environment," said one source close to the company. "They can't talk about it, because it's like giving away the store."

Through its four subsidiaries, QuesTech provides engineering, technological, management and support services for defense, national security, aeronautics and energy fields. Clients include the National Aeronautics and Space Administration and defense contractors including Boeing Co., Lockheed Corp., McDonnell Douglas Corp. and Northrop Corp., Klotz said. The company works with the U.S. Army Signals Warfare Laboratory in Warrenton, Va., and the Naval Ocean Systems Center in San Diego.

The company assists the Army by analyzing the performance of communications systems, and assists the Navy by using computer-aided design to help develop the tactical communications equipment associated with combat ships, one source said.

QuesTech's Newport News subsidiary, Dynamic Engineering Inc., builds dynamic aerospace models, such as airplanes, helicopters, parts, tail assemblies, and rotor blades for free-flight and wind tunnel testing of aerodynamic performance. It also has developed highly sophisticated, computer-aided machines for use in designing models for clients such as NASA and the Defense Department.

Another subsidiary, Engineering Resources Inc., based in McLean, performs electronic weapons support services at government installations around the world, Klotz said. ERI and Quest Research Corp., a McLean division that designs equipment for high-tech electronic warfare systems and packages national security-related computer software, hold a joint contract with the U.S. Army Signals Warfare Laboratory, Klotz said.

Lastly, DHR Inc. provides professional and technical services in energy technology and policy, energy conservation planning and technology assessment, Klotz said.

Over the past five years, QuesTech's revenue has grown steadily from about $10 million in 1979 to more than $27 million in 1983, when revenue jumped $10 million over that of 1982. The company's profits had hovered at about $250,000 a year until 1983, when they quadrupled to more than $1 million.

The company reported a 13.6 percent revenue gain for the second quarter ended June 30, to $7.7 million from $6.8 million a year earlier, and a 19 percent increase for the first six months of 1984, to $15 million from $12.7 million for the same period of last year. QuesTech reported a slight decline in profit during the first three months of 1984, but an overall 6 percent increase in profit for the first six months compared with 1983.

The company's prospectus states that a large government contract, from which the company derived about 26 percent of its revenue in 1983, was terminated in April. The company's big jump in profits occurred "because of that contract, no question about it," said Klotz, who could not disclose details of the contract.

"This contract kept a portion of our facility . . . busy on a dedicated basis three shifts around the clock." But after the contract was terminated, Klotz said, the company had to continue paying valuable personnel -- some of whom have clearances above top secret. "We just can't let people go because the competition would be glad to take them over, and that meant diminishing the profit."

Other factors that have affected the company's finances in the past include congressional delays on appropriations bills, congressional criticism of government use of outside contractors, a sagging economy and "contracts not materializing as rapidly as we think," Klotz said.

Although Klotz will not divulge the back-order situation at the company, he says full-year earnings will top last year's $1 million. The reason? "Right after this contract was canceled, there was a lot of bid-and-proposal activity to fill it up. In August we recovered, and in September we were very good again, and the facility is working again three shifts a day."

Klotz attributes the company's knack for acquiring contracts to its reputation. "We have been growing all along . . . and became more and more professional in every aspect of our work. We gained credibility with our customers -- name recognition, which brought in more work. We became better at managing."