Having attended and organised a few hackathons recently, I've been impressed by their ability to glue together the local tech community, university students, and local companies. Hackathons work best when they have some sponsorship behind them; this lends some status to the event and, of course, cash to incentivise participants with food and prizes. As a company, you may be approached by a third party organising a hackathon. Here are some tips on how to get the most out of the event. You may even wish to organise a public hackathon yourself; the same applies.
Here's what you do as an employer. First do your due diligence -- check the organisers are legit, how many people they can genuinely pull in, whether they've secured an appropriate venue, and so on. If all is well, you then put some money into the hackathon to support it in some way. This could be covering the catering (e.g., lunch on each day), sponsoring a prize, or simply handing over an amount for the organisers to use as they want. (A note to newbie organisers here: sponsors will really appreciate a mention on the web page for your event. If you don't have a web page yet, make one! It's a good idea to ask how they want their name and/or logo to appear.)
Go to the event and bring a few employees; if possible, developers would be best! Put a few flyers for your company around the venue. See if you can even convince some employees to get stuck in and participate. For those not participating: interact with the groups, find out what they're doing, how they're doing it, what technologies they're familiar with, and so on. If you're sponsoring a prize, then you'll likely also be acting as a judge. This gives you yet more opportunities to quiz the teams and find out more about the members, and a chance to highlight their achievements at the end.
It's important to not make it a recruiting drive. The participants' primary focus is their projects; they'll likely become alienated by heavy-handed recruiting. They already know you're a company and possibly looking to hire some talented developers, so no need to remind them of it.
At the end-of-event round-up, briefly mention your company, what it does, and how/where to find out about job opportunities there. Being a sponsor of a prize helps here since you'll naturally have the floor for the moment while you announce the winners.
There are many benefits to sponsoring a hackathon, for both company and participant. First, you get a feel for the prospective employees. You've seen them working on a practical project over two days. You have an impression of their personality, how they work in a group, and their experience with various technologies. In fact, at the end of the event, for some of the participants you'll already have answers to the behavioural questions that might be asked during an interview. This is especially true if you (or your employees) participated in a few teams.
Your company's profile will be raised, and with key people in the local tech community. Typically, hackathon participants are very active in tech. They keep up with trends, they love Twitter, and, importantly for you, are well connected in the community. Even if you don't get a direct hire out of the hackathon, world will spread among the acquaintances and friends of participants.
For participants, they'll (hopefully) leave the event with a positive, lasting impression of your company, your employees, and the culture within your company. Traditional advertising will not buy you that level of engagement. (Participants will also, of course, be very grateful for the free food and/or prizes.) The organisers will be very appreciative, and will gladly mention your contribution to the event.