Not long ago, the major problem encountered by potential visitors to China was how to gain admittance. Today, with some 2 million foreign tourists a year visiting the country, the problem is finding a hotel room.

Gone are the days when it was not unusual for the foreign traveler to have a 200-room hotel all to himself. On my first visit to Peking, in 1956, I stayed at the just-completed Xin Qiao Hotel, a massive structure of gray stone built in the former Legation Quarter. The only other foreign guest was a dishevelled Australian communist. In the hotel restaurant, a dozen silent waiters constantly hovered around my table with puzzled concern.

When I returned in 1965, the Xin Qiao had changed. Some Japanese and French tourist groups had made a timid appearance, and there were only two waiters per guest at the restaurant.

When I last visited Peking, in June, the Peking Hotel would not even put me on the waiting list. The Lido Hotel had canceled my reservation because my plane was late, and it was only after considerable kowtowing that the Jianguo Hotel conceded me a room for one night. The next day I finally did get a room at the Lido, but only for two nights.

The overwhelming majority of foreigners come to China on group tours, and for these the Chinese will have arranged reservations. For the rare individual traveler with no contacts in Peking, finding a room during the tourist season was until recently tantamount to Chinese roulette. But this has changed, and some hotels will even accept reservations from abroad . . . which was unheard of a few years ago.

Between the establishment of the People's Republic of China in 1949 and the Fall of the Gang of Four in 1976, tourism in China was severely limited. But by the late '70s the country had entered the age of mass tourism. It rapidly dawned upon the authorities that, while there was much to be gained by opening the country to the outside world, the foreign hordes had to be provided with a place to spend the night.

The Chinese take no half measures. What followed was a massive hotel building program, often as a joint venture with foreign capital. To staff their hotels, thousands of young Chinese have been put through an intensive one-year English language course specially designed by Peking's Foreign Language Institute. The result is that Peking today has a number of luxury hotels that conform to the highest international standards.

*The Peking Hotel is the Grand Old Lady among the city's hotels. The original central wing, built in 1930 by the French, was known as l'Hotel de Pekin. In the early 1950s, the new regime built the eastern wing, overlooking the Forbidden City, with everything -- rooms, beds, furniture -- of monumental proportions. In the early '70s a 16-story west wing was added, with unusually large rooms with high ceilings and central air conditioning. (The old wings also have been refurnished.)

The hotel offers any number of restaurants and -- in addition to the usual facilities -- a grocery store, a Chinese traditional drugstore and an in-house acupuncture doctor. While the service is not the best, the Peking Hotel has the atmosphere of a dignified old steamship.

Individual rooms cannot be reserved from outside China. To get into the Peking Hotel you will either have to come with a tour that has the good fortune of being booked in it; be an official visitor; or have powerful friends in Peking. Rooms start at about $35 single.

*The Jianguo Hotel is the antithesis of the Peking Hotel. The 454-room Jianguo was built on the model of a Palo Alto Hotel as a joint venture with the Peninsula Group of Hong Kong. The rooms tend to be on the small side, but the service is superlative and there is an indoor pool. Its various restaurants span the full range of western, Chinese and Japanese cuisine, and the coffee shop has become a favorite with the western community.

Individual reservations can be made either through the Peninsula Group or through Swissair, Cathay Pacific or Pan Am. Rooms range from about $70 single to about $150 for a duplex suite.

*The Great Wall Hotel opened on June 20, after a six-month trial operation highlighted by a formal dinner hosted by President Reagan. A 24-story, $75-million steel-and-glass extravaganza, it was set up as a joint venture between the China Travel Service and the S.E. Pacific Development Construction Co. It offers 1,007 rooms and 13 banquet rooms, one of which can seat 1,000 people. In terms of facilities, the Great Wall Hotel has everything.

Rooms range from about $96 single, to $1,000 for a deluxe suite. Reservations can be made through various airlines, including Cathay Pacific, CAAC and British Airways, or directly by telex.

*The Lido, the city's third joint-venture hotel, was built in association with a Singapore group and Holiday Inn. Situated on the road to the airport, it is somewhat less well located for the individual traveler, but is well suited to tour groups. The atmosphere is pleasant. In the afternoon, a harp-and-piano duo play in the lobby; the service is friendly and efficient, and the rooms, all air conditioned, are more than adequate. A single costs about $40.

*Other options include: The Yanxiang Hotel, built near the airport jointly with a U.S. group, provides all the necessary facilities for travelers who are only in transit in Peking. The Fragrant Hills Hotel was built two years ago on an I.M. Pei design, in the city's western hills. Ideal for a convention, the Fragrant Hills (or Xiang Shan) Hotel suffers from the handicap of being a $20 taxi ride from Peking. The same can be said of the Friendship Hotel, built in the 1950s to house thousands of technicians sent by the Soviet Union. While room rates are reasonable, the taxi fare from town is about $20.

As for Peking's old hotels, with their high ceilings and polished parquet floors, they have been increasingly sought either by foreign residents waiting for an apartment or by tour groups. Among the older hotels that should not be overlooked are the Qianmen, which provides simple accommodations, and the Minzu.

Peking can now boast of several hotels of high international standards for individual travelers willing to make their own reservations. But it is still true that for the majority of foreign visitors, the choice of hotel will be made by a travel agent, and ultimately by the Chinese.