When Carlos was 14, he dropped out of school and went to work as a tailor in his homeland of El Salvador.

Now, nearly five years later, he has grander ambitions. Every morning he boards a school bus for Bethesda-Chevy Chase High School, where he spends most of his day studying English, algebra and science in an effort to close the gap in his education. To make ends meet, he works for eight hours after school behind the cash register of a Silver Spring gas station. He does his homework between midnight and 1:30 a.m., when he stumbles exhausted into bed.

Despite his resolve to get a high school diploma, Carlos, now 18, flunked the state's functional reading test last year, one of four examinations he must pass to graduate by 1988.

Carlos' failure on the exam, hardly unique among Hispanic refugee students, reflects a tricky new problem facing Montgomery County school officials. In the county's schools today there are about 400 refugees who have had virtually no previous schooling.

"My guess is that with Hispanics, that group is changing demographically," said Jim Myerberg, director of testing for the county schools, referring to a shift from the generally better educated, middle-class Hispanic students who moved here in the 1960s and 1970s to the recent wave of poorly educated refugees from rural parts of El Salvador and Guatemala.

The number of students from El Salvador alone has surged from 356 in 1982 to about 800 this year, with more projected for next year, Montgomery school officials said. Overall, the county's English as a Second Language (ESOL) program has doubled since 1977, from about 45 teachers and 2,000 students in 70 schools to about 120 teachers and 4,200 students in 130 schools today.

Similar trends have emerged elsewhere in the Washington metropolitan area. In Prince George's County, for example, school officials said 300 of the 1,800 ESOL students in the county arrived with little education and now are enrolled in basic skills courses.

Fairfax County school officials said about 400 of the 4,000 students in that county's English as a Second Language program have gaps in their education. There are 200 students in the program who are over 17 years old.

To cope with the wave of refugees who have entered Montgomery County in the last five years, school officials have hired language teachers and added special classes in basic skills to help the new students catch up with their American counterparts.

Although these barely literate refugee students constitute less than 1 percent of the total school population, their presence already has had a noticeable impact on the educational system.

Officials believe a recent decline in countywide functional test scores and a lack of progress on achievement test scores for Hispanic students is due largely to the growing number of Central American refugees with little or no schooling.

The downward trend on the functional test scores contradicts a national study done last year that showed that reading skills of Hispanic students increased steadily between 1975 and 1984.

"These kids are definitely affecting the test scores," said Dora Klayman, the head of the ESOL department at BCC High School, which this year has about 20 students from El Salvador, many of them lacking basic skills. "And I think the scores will get worse."

Myerberg said his office is conducting an in-depth study on why the scores of Hispanic students are declining.

Many of the new refugees can barely read or write, add or subtract, and must be placed in third- or fourth-grade-level classes even though they are teen-agers, according to teachers. To transfer from ESOL into regular classes they often need twice as long as well-educated foreign students who speak no English.

The new refugees' problems in the classroom are compounded by the fact that many need to work after school, which leaves little time for homework or a social life.

Carlos, for example, who started in the ninth grade at BCC after moving here last year, works at the gas station 42 hours a week and gives much of his $178 weekly pay to his three older brothers to help pay for groceries and the rent on the two-bedroom apartment they share. He sends the rest of the money to his parents and five brothers and sisters in El Salvador.

"When my friends go dancing on the weekends, I'm working," said Carlos.

Manuel, 16, a quiet youth with Indian features who shrugs his shoulders and looks away when teachers ask him questions, attended school until the fourth grade, when he quit to go to work harvesting corn in a rural province of El Salvador. He arrived in this country illegally four months ago and lives with his mother, father and two brothers in a Silver Spring apartment complex. Manuel cleans offices after school.

Mirna, a sweet-faced 16-year-old with dark shadows under her coffee-colored eyes, quit school in El Salvador in the eighth grade. But even before then, she missed school frequently so she could stay home to cook, clean and care for her younger brothers and sister.

She, too, cleans offices from 5:30 until 9 p.m. five days a week to help her father, who is out of work with a back injury. "I want to learn English and help my father," said Mirna, who has been in this country less than a year.

Although students like Mirna and Manuel are exempt for one year from taking the four required functional tests needed for graduation -- reading, math, writing and citizenship -- that may not be enough time for them to learn English and catch up on the subjects needed to pass the exams.

Mary Kalandros, head of the ESOL program at Wheaton High School, said several of her Central American students must take the test this year, even though they will not be ready.

"They will do terribly," she said. "There is no way they could pass the functional writing test or the reading test or even the math test."

"It's hard to read the test scores and tell people they are not stupid," said BCC's Klayman.

Last year, the number of ninth grade Hispanic students who passed the state's functional reading test declined 6 percentage points from the previous year. The number of Hispanics passing the test in the 10th grade declined by 7 percentage points from the previous year.

On the state's functional math test, 63 percent of Hispanic ninth graders passed the test last year, a 3 percentage point drop from the previous year. In comparison, the number of white students who passed the two tests increased or remained the same at all grades. The passing rate for black students increased or remained the same at every level except 10th grade, where the passing rate for blacks on the reading test declined by 1 percentage point. The number of Asians who passed the math test increased at all grade levels and the number on the reading test increased or stayed the same at all grades except in the 10th grade, where it declined by 8 percentage points.

In the California Achievement Test, which is given to all third, fifth, eighth and 11th graders to measure their skills in reading, math and language, Hispanic eighth and 11th graders have made no gains over the last five years, unlike black and white students. Asians made gains in all grades but the eighth.

A recent study by the school system's Department of Educational Accountability shows that the longer Hispanic and Asian students are in the school system the better they do on functional tests, which lends credence to the theory that the more recently arrived refugee students are affecting test scores, officials said.

Emilio Perche Rivas, director of The Spanish-Speaking Community of Maryland Inc., a nonprofit organization that provides social services to refugees, said he fears many of the barely literate refugees will become impatient with their slow progress and drop out of school. "If we don't give them an out they are going to leave school in the first year," he said.

He said he and other Hispanic community leaders want to meet with officials of the Edison Career Center, a vocational education school in Silver Spring, to ask them to waive the English language requirement for some students so they can enroll in the programs.

But Robert Laird, director of the Edison Center, said placing these students in vocational programs will not solve their problems. "Our programs require knowledge of language and math, and to put them here would be to doom them to failure," he said. Laird said refugee students with few basic skills would be better served by work-study programs.

Teachers, meanwhile, say they are not about to give up on these students. "I would say yes, most of these kids will make it," said Kalandros, noting that many of her former refugee students at Montgomery Blair High School have passed all the functional tests.

Klayman, too, is hopeful that her students will graduate, especially Carlos. In one year, she said, he has progressed from addition and subtraction to beginning algebra.

"He's lucky in that he's basically smart and his intelligence compensates for his lack of time," she said. "If he were not as smart as he is, he could not possibly do what he's doing."

Carlos has ambitious goals in mind. After he graduates from high school, he said, he plans to work for several years and save enough money to go to college. He wants to be an engineer. "If I want to be something in life, I know I have to finish school," he said.