When the youngest daughter of President Anwar Sadat and the son of one of Egypt's richest men married recently, Cairo newspapers reported that only tea and sandwiches were served to the guests.

It was one of many such messages that the government sent to the Egyptian people recently, saying the same thing in different ways: of course, prosperity is just around the corner, but we all have to go through a few tough years first, and the burden is being carride by the powerful and the rich as well as the common folk.

It was also a sign of the awareness in high places that Egypt'e economic plight carries the otential for discontent and unrest among the impoverished masses that threaten the stability not just of Egypt but of the entire region.

More than two years have bassed since Egypt's adoption of the so-called open door policy of encouraging foreign investment and private enterprise. That was to be the foundation for rebuilding an economy sapped by two decades of war, neglect and a state welfare system that was beyond the country's means.

The results have been negligible. It has become a cliche that the door is open but nobody goes through it. A discouraged American banker said recently that "you could count the major investment projects on one hand and have a few fingers left over."

Egypt is entering a critical period. A powerful combine of international forces, including the International Monetary Fund, has put intense pressure on the government for changes in the economic system that would reduce public expenditures and eliminate the obstacles to foreign investment.

But the government understood that these very remedies had potentially serious side effects. The rioting that broke out when some of them were put into effect yesterday bore out the worst fears of Egyptian analysts who thought the inevitable increases in prices and infaltion, already running 35 per cent or more a year, might tuch off popular unrest.

Those who were skeptical of the over-optimistic expectations of the government and who feared that the spectacular gap between the haves and the have-nots would eventually boil over turned out to be right sooner than they expected. The fear of this prospect has been behind the policy of many governments, including the United States, to do what they could do keep the friendly Sadat administration in power.

In a recent interview, Sadat dismissed as groundless fears that the country's economic dilemma would lead to public disorder. "It is ture that we have difficultes but that doesn't mean at all that we are a hopeless case," he said.

The high hopes aroused by the successful war with Israel in 1973 have led the Egyptians to ask for a better life, Sadat said, "and they have the right to ask for this. But it doesn't mean at all that there is instability or that we should not have started the muliparty system or this democratic system and free press all over the country."

Cynics say it is traditional for Egyptian leaders to allow a measure of political freedom when they have nothing else to offer the people. "Sadat cannot deliver the Sinai and he cannot deliver prosperity. This is all he has left," one scholar said.

One paper at least, the country is clearly in deep economic trouble.

Foreign debt exceeds the gross national product and Egypt must borrow more to make the payments on its loans. This year's trade deficit is expected to exceed $3.3 billion. Foreign currency reserves are officially listed at $344 million but Western bankers say that figure is illusory.

Agricultural production is stagnant and possibly declining while the population is exploding at the rate of a million new persons a year. Some 35 to 40 per cent of the $17.5 billion budget goes to support the armed forces.

Beyond that Egypt is wedded to a state welfare system that is increasingly costly and, western experts believe, cannot be maintained much longer. The problem for the Egyptians is that if they reduce or cut off the benefits, as potential lenders and aid donors are insisting, the plight of the masses who depend on them will only get worse, at least in the short run.

The government is committed, for example, to providing free university education for those who want it and to providing jobs for the graduates. The result is that "they have 400,000 university students wandering around," as a long-time resident put it, and government offices and state-owned industries are vastly over-staffed.

The potential leaders and aid dog ors want internal reform and reorganization as the price for more assistance, but the Egyptians say they need tion in the subsidies, along with other nate jobs and other services for the population.

A key question has been the government's extensive subsidies for basic foods and commodities such as wheat, tea and cooking oil. The sale of these goods in state-run cooperative markets at greatly subsidized prices enables at families of clerks and bus drivers and factory workers to get enough to eat. But it has cost the government more than $1 billion a year.

The IMF wants a substantial reduction in the subsides, along with other changes in the monetary system, as its price for providing $338 million in standby credis. But the government resisted contending that reduction of the subsidies would create hardships for the workers.

When the government yielded and announced Monday that the subsidies would be reduced or eliminated on most items, the popular response was swift and violent, creating just the kind of challenge to the Sadat government tha he had hoped to avoid.

The IMF has also asked the Egyptians to reduce other government spending, increase customs fees and reform the tax laws.

Egypt is understood to want the IMF approval not just for the immediately credits, but also as a sort of testimonial to other economic partners that this country is taking the right steps.

A consortium of the nations that give Egypt large amounts of aid has been organized by the World Bank and is to have its first meeting probably in March. The United States, Canada, several European nations and Arab oil states that are heavy contributors to Egypt are expected to participate. But Saudi Arabia and Kuwait in particular have made clear that they are not going to increase their assistance to Egypt unless reforms are made that produce long-terms results.

The reforms that western analysis say are needed are spelled out bluntly in a document entitled "Report on Foreign Investment in Egypt" recently published by the Egypt-U.S. business council.

Written by Lauren J. Suter, an executive of Chase Manhattan Bank, this report criticizes the Egyptian investment law and its implementation as deterrents to the investment of foreign capital here.

"Egypt holds a great potential for foreign investments. But the exploitation of this potential will not be realized until the impediments clouding the investment climate are lifted, and we can only suggest that the most urgent attention should be devoted to this task," the report says.

Egypt's shortage of foreign exchange and its artificial exchange rates are citied as the most critical areas of concern.

The official rate of exchange for one Egyptian pound is $2.56. But many transactions are carried out at the incentive or tourist rate of $1.44, the rate a visitor gets when he changes money at the airport.

Major international transactions, however, are carried out at the official rate, considerably raising the cost of doing business with Egypt.

Suter and other analysis want a currency exchange reform including devaluation.

But a substantial analysis of the pound would drive up the price of the imported commodities on which Egypt is so heavily dependent - again creating politically volatile short-term hardships until the long-range benefits can be felt.

The news is not all bad:

Western bankers and businessmen say they have been encouraged by a Cabinet reorganization that put a respected economic leader, Abdel Moneint Kaissouni, in charge of breaking the logjam. He and his new colleagues are said to have both the comprehension and the authority to respond to the demand for reforms.

Hotel construction is booming as the country seeks to exploit its potential for tourist development.

Oil has begun to flow through a new pipeline from the Gulf of Suez to the Mediterranean. This is expected to bring in some $110 million a year in transit fees. Egypt is already an exporter of crude oil, and production is rising steadily. A production goal of $1 million barrels a day by 1980 appears reachable.

A Japanese construction company is at work on $112 million widening and deepening of the Suez Canal, whose earnings in transit fees are expected to approach half a billion dollars this year and will increase when the canal can handle large ships.

The question in the minds of government leaders not only here but in Israel and in other Arab states is whether all this will bring enough results fast enough to keep the moderate Sadat government in power and ward off the radical and extremist elements that are already trying to capitalize on popular discontent.