Justin Trudeau hacked Hack the North.

With less than a day’s notice, Canada’s 23rd Prime Minister made what was for some a surprise appearance at University of Waterloo’s Hagey Hall Friday night, delivering a 7 ½ minute speech to raucous cheers, and in so doing kicking off the fourth iteration of Hack the North, Canada’s biggest student hackathon. He left his audience of more than 700 coders and hackers begging for more of his trademark charisma.

“This might be old news, but I really get a kick out of this stuff,” a smiling Trudeau told a delighted audience.

“Hack the North will give you a chance to not only let your imagination run wild, but to meet other people who can help you solve problems: mentors, friends and colleagues, who will challenge you to take your ideas a step further.”

More than 1,000 students from around the world, chosen from some 6,200 applications, will work for 36 (mostly sleepless) hours over the weekend, writing code and forging projects that they will then present to a panel of judges Sunday afternoon.

Trudeau, who earlier in the day was in Montreal for the launch of Facebook’s new artificial intelligence research lab, used the Hack the North event to talk about Canada’s diversity and the way diversity feeds a healthy technology ecosystem.

“In Canada, we figured out the hard way, through a lot of hard work and a lot of mistakes, that diversity, differences of opinion, differences in perspective, differences in background, are an amazing source of strength, of resilience, of creativity,” Trudeau said.

And then the Prime Minister reminded his audience that Canada stands ready to support entrepreneurs and technology enthusiasts no matter what country they currently call home.

"Companies like Google, Microsoft, have chosen Canada because our people are educated, ambitious and innovative. Which is good news for all of you," Trudeau said.

"We know when someone thinks differently from you, it’s not a reason to push them away and not listen to them, it’s a reason to lean in and figure out why and where they think differently from you, [and discover] if together you can figure out a new way of solving a problem.

"That’s what diversity is and that’s what I see throughout this room.

“When you’re starting a business or looking to change the world, remember that you can do both right here in Canada,” Trudeau said. "This is one of the best places in the world to do either of those things.

“Canada is brimming with innovation and talent and you are all poised to benefit from it.

“And if you do decide to challenge yourself across the globe, you’ll do it secure in the knowledge Canada will be waiting for you whenever you chose to come home, or [chose to] make it your home.

“Dream big, work hard, have fun, enjoy the next few days, and get hacking!”

Trudeau then gave up the stage to Balaji Srinivasan, CEO of digital currency company 21.co., the event’s original keynote speaker. Srinivasan answered questions from Michael Gibson, General Partner of 1517 Fund, and the audience via Twitter, about Bitcoin, digital currency, and how to build a successful startup.

He had some unorthodox advice.

Asked by an audience member if everyone in the room “should work on something, turn it into a startup and move to Silicon Valley,” Srinivasan said no.

Instead, he said, he’d recommend going to work for a big tech company, “work extremely hard for a year, make yourself indispensable, and then turn down the promotion when it comes. Because you don’t want to be a manager.”

What you do want to do, he said, is negotiate the ability to work remotely, find a location in the world that offers the ability to live inexpensively – he used Thailand and Chile as examples – and bank the savings, generating “runway” to bootstrap a startup and forego angel financing.

“That concept of digital nomadism,” Srinivasan said, “is something that’s going to ramp in a huge way.”

No doubt that advice will ring in the ears of Hack the North’s participants, but in the meantime, there’s some frenzied coding to take place.

Judging of Hack the North projects will begin Sunday morning. Closing and final showcase will take place Sunday afternoon, beginning at 2 p.m.