hack_edEstefania Ortiz, a Stanford freshman wearing a pink hoodie with her school’s name emblazoned across the front, was coding away on her laptop when she suddenly stopped typing, threw up her hands up and said, “Oh my god, it worked!”

She was participating in HackEd 2.0, which, like it sounds, is a hackathon focused on developing education tech, held yesterday at Facebook headquarters in Menlo Park, CA. Moments before her breakthrough, Ortiz’s teammate, Ajay Sohmshetty, another member of the all-Stanford Freshman squad, had been giving her tips.

This month PandoDaily has been digging into education tech, an area of coverage that implicitly asks the question: In what ways will the next generation of students be learning? Here’s one thought: hackathons.

Of course, education hackathons are nothing new, and neither is the idea of using them as teaching tools. But HackEd, in its second iteration, is jointly hosted by Facebook and the Bill and Melinda Gates Foundation, and it has the potential to be a driving force in education. Stacy Childress, deputy director of next generation learning at the Gates Foundation, says the hackathon as pedagogy tool is certainly a compelling concept. “The hack philosophy has great power,” she says. It’s similar to classic teaching techniques like group assisted work, just in a more intense, compressed time frame. “From what we know about learning, students engage more deeply in this setting.”

I don’t know if the hackathon approach is currently used at many schools before the university level, but if it’s not, maybe it should be. The value was clear yesterday, and not just because we were in the house Mark Zuckerberg built, in the same room where the social network announces product developments; this hackathon had a different air than the ones Silicon Valley has come to know and revere: the frenzied all-nighters with bleary-eyed devs hopped up on guarine, building and coding ad nauseam (though the Red Bull was flowing). This was as much about learning as it was about competing.

Hackathons are by nature collaborative, and this one, perhaps owing to the spirit of the event, had a particularly pedagogical bent. Team members ranged in age from 15 well into middle age. The winning project was a nifty lock screen hack by a company called Quizlet that won’t let you access your phone until you answer a foreign language question correctly. Another notable was a platform that connects high school students with students from prospective colleges. Ortiz’s group of Stanford freshmen built a type of Reddit for educational articles. Then there were the ringers: a team fielded by Facebook comprised of four of the company’s engineers, who created a search engine for demographic college information.

But the range of talent is what really gave the event a scholastic feel. Two teams from Hackbright Academy, a 10-week program that teaches women to code, built sites after only knowing how to code for five weeks. There were also Facebook developers and pitch coaches on hand to offer instruction. Because of the diversity of the pool, the quality of the team presentations at the end of the day varied widely. Some were tight and polished enough for a demo day in front of VCs, and some – without shame – naturally looked like high school group presentations.

And that is, perhaps, the genius of it. Nick Punt, president and cofounder of EdSurge, a website devoted to news on education tech, compares it to other things that are a bit more common is schools, like robot competitions. “Having a tangible goal is best,” he says, “and that’s easier when you’re doing something technical.”

There are many in the tech world advocating for coding and computer science to be taught at the K-12 level. Particularly determined are Hadi and Ali Partovi, the veteran Silicon Valley investors who collectively backed or advised Dropbox, Facebook, Airbnb and Zappos. The two brothers launched Code.org in February, which seeks to solidify such a curriculum by providing parents resources but also by helping to fund programs. It would follow that, if their efforts are fruitful, maybe hackathons aren’t far off from that.

The Gates Foundation, in its philanthropic zeal, made sure there was a socially conscious component, citing statistics that say only 8 percent of college students from low-income backgrounds end up graduating. Sheryl Sandberg, Facebook’s COO, during the event’s keynote spoke about the state of education in the country: “It’s impossible, in my view, not to see how we’re failing, across the board.”

So for at least a day, Facebook headquarters was evocative of a classroom. The corny motivational posters plastered all over the conference room that say things like “FORTUNE FAVOURS THE BOLD” and “WHAT WOULD YOU DO IF YOU WEREN’T AFRAID?” suddenly hit the right note when a soon-to-be first generation college student and her team from the nonprofit College Summit sits yards away coding an app that connects high school kids with college applications and school reviews.

Of course, in this light, it’s easy to get too lofty. After all, it’s just a hackathon. It certainly smelled like one. Walking past one corner, you get a strong whiff of spilled Red Bull. Punt sums it up beautifully: “A hackathon is just a big ass learning session for adults.” And if we’re smart, more and more for younger students, too.