When John William Warner got out of law school in the early 1950s, he wanted to work for Judge E. Barrett Prettyman of the District of Columbia Court of Appeals but did not have the necessary credentials: his law school grades had not been outstanding.

So the ambitious young attorney employed what he calls "a very good memory" and memorized every opinion the judge had written. Then he challenged Prettyman to quiz him on what he knew.

Warner got the job.

Today as he stumps for Virginia's junior seat in the U.S. Senate against Democrat Andrew P. Miller John Warner faces a somewhat similar test.

Lacking the sort of state experience that has traditionally paved the political way in Virginia, he is challenging the voters to quiz him on how well he knows their mind.

Across the state at the ox roasts and barbecues that fuel that autumn rituals of election, the graying former Navy secretary tells voters: "It's important for you to know all about me and what I stand for . . . Ask me anything . . . anything at all."

On the surface Warner would seem to have this job won as well. Said one GOP official in introducing him to a recent campaign luncheon crowd: "If you set out to design a perfect candidate you couldn't do better than John Warner."

Polished, handsome and rich, he stands in his custom-tailored suits and speaks confidently of helping guide the nation through "perilous days" and of negotiating with the Soviets "eyeball to eyeball."

From the relatively humble beginnings as a Depression-era doctor's son he has worked his way through careers as a sailor, student. Marine combat officer, lawyer, businessman, political advance man and subcabinet appointee and - to top it all - he chaired the agency that spearheaded America's 200th birthday party.

The graphics of his campaign say it all: one arm of the "W" in his name ends in an eagle's beak from which streams the red and white of the stars and stripes.

"Warner," the banner says "Listening to Virginia."

Warner - and the aides who brief him - have been listening well. He is, as Gov. John N. Dalton puts it, "talking the sort of language Virginians want to hear."

He talks of cutting taxes and trimming spending, ending inflation and balancing the budget, beefing up defense and getting tough with the Russians - the blunt, no-nonsense themes that endure year-in, year-out in the Virginia conscience.

Warner is, moreover, the heir of an aggressive Virginia Republican Party, which in 10 years has vaulted from nowhere to become the dominant political force in the state. It is a party heady from its victories and thirsty for more.

Warner and his campaign, however, are laced with contradictions and ironies.

He was not the first choice of his party (the original nominee, former GOP state chairman Richard Obenshain, died in an Aug. 2 plane crash) and a number of Republicans working hardest for him are quick to say, off the record, that they do not like him.

His strongest claim to national stature - his years as secretary of the Navy - have become one of the major sources of controversy in the campaign.

Most of all, there is his image, which serves simultaneously to enhance him and to undermine him in many voters' minds.

At age 51 Warner, as one Richmond Republican ruefully acknowledges, "is really a creature of Washington" - its drawing rooms and embassy parties, its limousiness and glitter.

Husband first of an heiress (Catherine Mellon) and then of a movie star (Elizabeth Taylor), he exudes a kind of high-priced charisma that a glamor-hungry housewife in Springfield might find compelling but a Tappanhannock farmer might not.

Warner works hard to emphasize his family ties to Virginia. He never mentions his Georgetown town house or his boyhood in Washington's now-fashionable section of Cleveland Park, and he almost apologizes for being born in the District of Columbia.

At one campaign appearance, his octogenerian mother stood up and declared that if she had known her son would run for the Senate from Virginia, "I would have crossed the river and had him under the trees."

Warner also works at cultivating a folksy image. On a Danville radio call-in show last month he referred to himself as "a farmer . . . a cattleman" and his 2,100-acre Fauquier County estate where he goes foxhunting as "a real nice spread."

"And I love country music . . . it's real culture," he added. "You know, overseas country music ranks right up there with Beethoven. . . "

John Warner, however, remains essentially the farm boy from Cleveland Park.

Those who remember him in college at Washington & Lee remember him as a rather "social," hard-working youth who "became a little more flam-boyant" only after his 1957 marriage to Catherine Mellon, - a marriage that turned him into a millionaire over-night.

Much has been made in the current campaign of the role of the Mellon money in Warner's political ascendancy, but most of those who know Warner well believe he would have been successful even without it.

They point out out that he won the clerkship with Prettyman on his own and was a competent prosecutor in the D.C. court system afterward.

In the Washington law firm of Hogan and Hartson, which he joined in 1960, Democratic lawyer remembers him as a good attorney, who was being groomed to succeed one of the senior partners as the firm's expert on banking law.

Those who know Warner say that, rather than with raw brain power, he has won friends and achievement with a combination of enthusiasm and ambition - qualities that have also caused him problems with both large matters and small.

Several neighbors of Warner in Fauquier County say the same qualities led Warner to be "overmounted" frequently in the hunts and races of the Virginia horse country: riding a larger and more powerful horse than he either needed or was able to control.

Enthusiasm and ambition are also blamed by many of Warner's friends for the candidate's propensity to say things that do not quite jibe with the facts.

Warner, for example, likes to tell rural audiences he "was raised on a farm." Questioned closely about that assertion the candidate says that his father, a Washington gynecologist, had patients who lived near Middle-burg, and he would visit them in the summer.

Statements like that have plagued Warner throughout the campaign.

Last week at a fund-raiser in Charlottesville, asked to comment on Vietnam veterans, Warner said he believes "they ought to be treated the same way this nation has treated every other veteran which in most cases has been pretty shabby."

At a dinner in Newport News, later in the week, he encountered Lewis Puller, the quietly intense, 1st District Democratic nominee for Congress, who lost both legs and part of both hands in Vietnam. Warner bounded up to Puller's wheelchair, clapped him on the back and boomed: "Whaddaya say, tiger!"

Warner's enthusiasm, however, is also one of his most appealing qualities. Even the severest critics of his Pentagon years concede him boundless energy, and the ability to bounce back in the face of any problem.

Last week in Hopewell, Warner encountered a voter who told him, "I don't think I like you but I'm going to vote for you."

"I don't think I like you either," Warner replied sunnily, "but I accept your vote."

The wearing pace of the campaign, however, drains even the most resilient, and at the end of a 16-hour day, when crowds are gone and dinner is a hamburger grabbed from a fast-food restaurant where nobody knows his name, John Warner shows the numbness of fatigue and wanders off to call his wife like any lonely husband on the road.

Then he boards his chartered plane and, as he wings through the night toward Suffolk, he dons his metal-rim reading glasses and struggles to focus his mind on a stack of clippings and papers from his staff. Tomorrow will be another test and John Warner will need to know the right answers.