How tech literate are 8th graders? You'd be surprised.

8th grade tech

How well is America preparing its youth for tech-based jobs?

To find out, the U.S. Department of Education tested 21,500 eighth graders in 840 schools for literacy in technology and engineering.

It was the first-ever such assessment of students conducted at a national level.

43% of students tested at or above the "proficient" level, which was "pretty good," according to Peggy Carr, acting commissioner for the National Center for Education Statistics (a part of the Department of Education).

But what surprised Carr even more was the gender result: Girls scored three points higher than male students on the test.

"It's clear from the data that, on average, girls are better able to understand and evaluate technology and then use it to solve problems and achieve goals," said Carr.

Related: Facebook's ad chief: Let's rethink STEM

The test took five years to prepare and was administered January through March of 2014.

It was designed to measure students' competency skills in three areas: technology and society, design and systems, and information and communication technology.

The test also evaluated their thinking and reasoning around technological principles, developing solutions, and communicating and collaborating.

"We wanted to dig deep into the K-12 system to see to what degree are students being prepared for 21st century job skills," Carr said.

Each student had an hour to answer two scenario-based questions. (There were 20 real-life scenarios overall.)

For example, students were asked to help a city design a safe bike lane. They had to understand the criteria and produce a route that was safe, short and inexpensive.

Related: This truck brings STEM classes to low-income schools

In another challenge, students were asked to create content for a website to promote a new teen rec center. And one test asked students to redesign and improve a wire mesh cage for a classroom iguana, based on its basic needs.

In a separate questionnaire, students were asked where and how they developed their technology and engineering skills.

Two-thirds said their families taught them about building things, fixing things, or understanding how things worked. Carr said this could be an opportunity for more schools to offer STEM-focused classes so that the learning was more consistent across the board.

Related: America's most innovative schools

But some people said the test results were a cause for concern.

"I don't think that 43% of students meeting proficiency level is something to celebrate. It needs to be much higher," said Dr. Vince Bertram, president of Project Lead the Way, a nonprofit that partners with K-12 schools to provide STEM classes.

"We have to do a better job preparing our pipeline of skilled workers," he said. "We want to help student not just fill a job but also be prepared to find their next one."

Still, Bertram said he's encouraged to see that girls fared better than their male peers.

"There's this perceived gender bias in STEM, which discourages girls from pursuing technology and engineering," he said. "The test shows that this can be changed if we get to girls early enough in school, before the gender bias sets in."

CNNMoney Sponsors