A last-minute effort to avert a strike tonight at the Newport News Shipbuilding and Dry Dock Co. failed yesterday after federal mediators in Washington Shuttled for nearly three hours between high-ranking officials of the company and the United Steelworkers of America.

Steelworkers spokesman Bill Edwards said the union would post pickets outside the company gates in Newport News, Va., this evening in time for the 11 p.m. shift change, although the strike does not officially begin until midnight.

Edwards charged that literature passed out by a rival labor group, the Peninsula Shipbuilders Association, was inflammatory, and predicted that PSA members would resort to violence.

Yesterday's meeting, called last week by the Federal Mediation and Conciliation Service, never brought the two sides together. The company delegation, led by shipyard president Edward J. Campbell, refused to talk directly with the Steelworkers, led by international president Lloyd McBride.

The company has refused to recognize the union, which won a representation election over the PSA last Jan. 31, and has charged that the election was fraught with irregularities. The charge is now before the 4th U.S. Circuit Court of Appeals in Richmond.

Representatives of both sides sat in separate conference rooms at the mediation service offices here sipping coffee while William P. Hopgood, the service's top mediator, and Commissioner Gilbert S. McCutcheon shuttled between them. Afterward, Campbell and McBride held separate press conferences, allowing enough time between them so that representatives of neither side would meet in the hall.

A mediation service official who was asked later what had gone wrong responded, "What went right?"

Citing the mediation service's "deep concern for a labor dispute of this magnitude," Hopgood said he would try to stay in touch with both sides, but that no further talks were scheduled.

McBride predicted that 80 to 90 percent of the yard's 17,000 production and maintenance workers would back the strike. He threatened to throw "the full resorces of this international" into the strike, and said the union expected to pay $500,000 a week in strike benefits from its $90 million defense fund.

"We're prepared to take a strike," Campbell said, but added later, "I would hope there would not be a strike, and if there is one that the workers would not support one." He said the strike threat had already cost the yard overhaul contracts on five ships.