When Associate Justice William H. Rehnquist arrived at the Oval Office last Thursday for an interview with President Reagan, the team of three top administration officials who had been secretly searching for a new chief justice was uncertain what would happen.

The group consisted of White House chief of staff Donald T. Regan, White House counsel Peter J. Wallison and Attorney General Edwin Meese III. They had come to a "consensus," as one recalled it, that Rehnquist was the best choice to lead the Supreme Court. Rehnquist was the first candidate Reagan had wanted to interview.

After talking with Rehnquist about his health, about his willingness to serve and about his legal philosophy, but not about specific cases or issues such as abortion, Reagan surprised his advisers by offering Rehnquist the position on the spot. "He liked the answers," recalled a White House official who participated.

Thus Reagan completed the selection of a nominee to be the 16th Chief Justice of the United States in a matter of days by relying on his own broad principles, one interview and a minimum of written material, including a digest of Rehnquist opinions and some newspaper and magazine articles about the court, White House officials said.

In selecting Rehnquist, they added, Reagan's primary goal was a chief justice who shares his philosophy of "judicial restraint" -- that the courts interpret the law but should leave to the elected politicians as much as possible the business of creating or repealing the laws.

The president then repeated the process to fill the court seat vacated by Rehnquist's elevation. Reagan acted in concert with a consensus of his three advisers. The only candidate he interviewed was Judge Antonin Scalia of the U.S. Court of Appeals for the District of Columbia. Reagan offered him the job at the end of an Oval Office interview Monday afternoon in which they did not talk about specific cases -- just overall philosophy, according to participants.

In making these two nominations aimed at leaving a conservative imprint on the court for many years after his presidency, Reagan appears to have relied on his instincts and philosophy rather than on detailed analysis. He also relied on his advisers to bring him candidates who largely shared his views.

From the beginning of the search, Reagan also made a decision that excluded his longtime adviser, Meese, from becoming a candidate for the second opening on the court during his presidency. Officials said Reagan instructed them to search for candidates among the ranks of sitting Supreme Court justices and judges already on the bench. That stipulation removed Meese from consideration.

The president's decision to narrow the field to judges and justices was taken partly because it would be easier to assess the record of the candidates from their written opinions, a White House official said. But another presidential aide said, "It may have also been driven by confirmation politics. Someone who has been confirmed once is going to be almost certain to be confirmed again."

Meese, by contrast, experienced a stormy and difficult Senate confirmation as attorney general.

Meese told reporters yesterday, "I've always consistently said I was never interested. I said definitively, I think several months ago, it was reported in several of the papers, that I've never had any interest in being a judge and don't have any interest now and don't ever anticipate any interest in the future."

Chief Justice Warren E. Burger's plans to retire came to the attention of the White House late last month when, using former White House counsel Fred F. Fielding, he arranged a meeting with Reagan for May 27, officials said. Burger spent most of the meeting telling Reagan about his concern for the celebration of the 200th anniversary of the Constitution, of which he is chairman, participants said. At the end of the meeting, he announced to Reagan that he wanted to retire after this session of the court is over in July.

Two days later, the officials said, Reagan met with the three advisers who would secretly carry out the search for a replacement. "We didn't discuss candidates with him," said one, but Reagan told them to look at justices on the court and sitting judges.

The group of advisers, using material from the Justice Department, produced a list of 10 or 15 possible candidates for chief justice. For the most part, officials said, these candidates shared Reagan's broad philosophy.

The group then met with Reagan again on June 9. Wallison had prepared digests, about 15 pages long, of the judicial views of some potential candidates, including Rehnquist.

The president was also provided with newspaper and magazine articles about the court, including essays in the Sept. 29, 1984, edition of The Nation commenting on Burger's tenure as chief justice, officials said.

The opening essay by Herman Schwartz, a professor at American University's Washington College of Law, reported that the court, which Rehnquist joined in 1972, had in recent years taken a conservative turn, particularly in cases involving individual rights.

"Its direction is away from concern for individual liberties and toward the imperial perspective that says, 'Don't question authority,' " Schwartz wrote, attributing the shift in part to the addition of "the rigidly ideological" Justice Sandra Day O'Connor to the conservative Rehnquist.

By the account of those involved, Reagan quickly zeroed in on Rehnquist early last week. On June 9, one participant said, some candidates "clearly stood out in the discussion. The president began to focus on a relatively few" candidates, this official said.

"Reagan liked what he heard" about Rehnquist, another participant said, and a meeting with him was set for last Thursday, with the president, the justice, Meese, Wallison and Regan in attendance.

"I didn't know what would happen," recalled one of them, "whether he would decide on Rehnquist or say continue the process. At the meeting he liked Rehnquist a good deal. The president made inquiries generally . . . how he saw the direction of the court, how he felt he could deal with the job."

When Rehnquist accepted the president's offer and left the White House, Reagan then turned to a short list of other candidates to find a successor for him. Again, he settled on one candidate, Scalia, and invited him to the Oval Office for an interview, at which he offered him the job on the spot. Again, officials said, Reagan was impressed with Scalia's general agreement about a philosophy of "judicial restraint" and did not question him about specific cases or opinions.

In May, Burger told administration officials that he would wait for a White House signal about the announcement. That signal went out yesterday when Regan telephoned, asking him to come to the White House for the announcement.