Two current jokes illustrate Algeria's efforts to rationalize a generation of revolutionary commitment to socialism and set its inefficient economic house in order in an era of lowered expectations.

In the first story, President Chadli Bendjedid gets to a crossroads and is asked by his driver which direction to take. "What would President Reagan do?" "He always turns right."

"And what about Yuri Andropov?" "Invariably turns left."

"In that case," the president replies, "put the blinker on left and turn right."

The second story has a harassed Algerian hen under fire from the authorities for producing fewer eggs than her French and American counterparts. "What do you expect?" she says in her defense. "Every time I'm about to lay, I'm called to the party for a seminar."

The country's socialist principles were first adopted in 1957 in a congress of the Front de Liberation Nationale, five years before the nationalist insurrection triumphed and France granted Algeria independence. Under career Army officer Bendjedid, Algeria has not formally abandoned the principles, but for the past three years the government has sought to revitalize its long-neglected agriculture and decentralize the essentially state-controlled economy.

The FLN, which remains Algeria's only political party, has conducted a long series of educational meetings to impress on the party faithful the need for a change. The collapse of other countries' ambitious dreams--in particular, the recent history of Iran--was enough to help Algeria question its own goals of becoming in a single generation the "Japan of Africa" by concentrating on massive industrialization at the expense of farming.

Bendjedid has his eyes set on obtaining a new party mandate at the party congress later this year--a preliminary to presidential elections in which he is likely to be the only serious candidate. He is well aware of the need to satisfy an increasingly impatient public's demands for housing, cars and other consumer goods.

"But if the top levels know what to do and how to put their ideas into words," one western observer said, "they are having problems implementing their pragmatic views."

A few statistics explain a good deal of the problem. Algeria's population of 9 million at independence in 1962 is now more than 20 million. Unless the 3.2 percent annual increase falls, the population will nearly double by the year 2000.

Once self-sufficient in agriculture, Algeria now imports 70 percent of its food. While half the population is still rural, farming accounts for only 7 percent of gross national product.

An exodus from rural areas has put a major strain on housing, as farm youths rushed to the Mediterranean coast, where most of the new industry is located.

Hundreds of "political" factories put up with state funds and little eye to profitability are running at perhaps 30 percent of capacity with massive worker absenteeism a major failing. The work force is still largely unskilled and many Algerians complain of a dearth of foremen and other skilled supervisory personnel.

Even Algeria's light, high-quality crude oil, discovered in the fading years of French colonization, is now declining both in quantity, as known reserves diminish, and in price because of the world oil glut.

A bright spot for the economy is natural gas. Reserves are computed to be the world's fourth largest. Algeria signed a precedent-setting deal with France in 1982--setting for the first time an equation between natural gas and oil prices. Italy and other potential major customers, however, have yet to agree to the considerable subsidy that deal involved.

A campaign to lure trained Algerians back from France, where more than a million Algerians live, with promises of loans to start small, private businesses attracted only a handful of volunteers. The program's lack of success was blamed on housing shortages--despite an ambitious government building program--and the knowledge that the heavy-handed Algerian bureaucracy was likely to hamper private business operations.

Still, during the past three years, the government has registered some pathfinding successes in tinkering with the socialist system without dismantling it. One frequently cited case is construction, which has been decentralized with responsibility now in the hands of authorities in the 32 wilayas or administrative units, rather than at the ministry level.

Public works, rather than the Army, has the final say, and private contractors are winning important contracts with the state-owned enterprises for the first time.

The government seems willing to encourage the private sector, which accounts for 10 percent of GNP, by letting entrepreneurs fill the gaps in the socialist system and even compete with state corporations in production of clothing, shoes and other items.

While private enterprise in restaurants and hotels is encouraged, private initiative still can be sapped by laws preventing, for example, the firing of waiters. But the state has shown it can be pragmatic.

"It's one thing for the nationalized air carrier, Air Algerie, to have twice as many employes as it needs," one foreign observer noted, "since that is just a disguised way of reducing unemployment. But two years ago the government freed fruit and vegetable growing from state control, and supplies--and prices--increased."

Plans are afoot to break up into smaller specialized units the giant state farms and cooperatives that became part of the state sector when more than a million French settlers abruptly left in 1962.

Similarly, the government turns a blind eye on the black market, known familiarly as the "immigrant bank." French francs deposited in Paris are reimbursed in Algeria at two to three times the artificially low official exchange rate.

The government tolerates such illegal activity in part because of the mentality of its top echelons, in part because of Algerians' natural penchant for western consumer goods. Today's Algeria is a case history of the phenomenon of the elite feathering their nests, as first described by Milovan Djilas in "The New Class" a generation ago.

Essentially an Army regime, the Algerian system, like many other in the Third World, works by coopting potential rivals with cars, housing or access to luxuries. So Europeanized are Algerians that a generation after independence--and a massive Arabization program in schools--the influential French newspaper Le Monde still sells more than 20,000 copies a day here.

Past Algerian fascination with black Africa, the Arab world, even the struggle in the Middle East has taken a back seat to a genuinely popular drive to include Algeria in still vague plans for Mediterranean cooperation.

In one apparent fence-mending move, Bendjedid held a summit meeting last month with Morocco's King Hassan, the first since the two countries broke relations in 1976 in a dispute over the Western Sahara.

Algeria has been an enthusiastic participant in various conferences of Mediterranean socialists, especially with the ruling socialist parties in Greece, Spain and France, which remains its most important trading partner.

"Algiers is closer to Marseilles than to the Sahara oil fields," a western diplomat said, "and not just in terms of mileage."

It is that basically prowestern bent in the population that provided public support for a recent crackdown on Moslem fundamentalists, who had been active at Algiers University. The fundamentalists were accused of throwing acid in women students' faces and murdering at least two men students.

Late last month French police raided the suburban Paris villa of Achmad Ben Bella, independent Algeria's first president, who took up the cause of Moslem fundamentalism soon after his release from a decade and a half of house arrest here. Despite French official denials, insiders here are convinced that France acted at the request of the Algerian government and that the French police handed over a list of fundamentalist militants both in France and Algeria.