Programming decathlon: 10 Olympian coding challenges

The international athletic games have nothing on these 10 programming tasks tuned to test true endurance, versatility, and intestinal fortitude

Programming decathlon: 10 events to test your app dev mettle
Credit: Ben Barbante
Programming decathlon: 10 events to test your app dev mettle

The Olympic decathlon may do well in measuring athletic prowess, but it doesn't come close to gauging the intestinal fortitude, quick thinking, and pure endurance programmers display at the keyboard every day.

Lasting a mere two days, the Olympic version includes events that are over in seconds. Keeping software running goes on 24 hours a day, seven days a week, with programmers conquering far more than 10 tasks every day, with no gold medals to show for it. Sure, the boss bought beer that one Friday, but only after 19 straight days of work.

These 10 Herculean tasks are a true test of mental acuity, grace, and genius. Let's see one of those running, jumping, tossing billboards for shoe companies complete even one.

No. 1: Cobol-to-Node migration
Credit: Ben Barbante
No. 1: Cobol-to-Node migration

Event: Competitors take a stack of code that's been running smoothly since Kennedy was in office and transform it into a modern Web app based on the latest version of Node.js.

Rules: Code must duplicate all bugs in the original, including automatically converting all lowercase letters to uppercase and using only two digits to store dates.

Scoring: Points will be deducted for every state employee whose salary cannot be cut by the resulting Node system. Bonus points for use of Erlang or Haskell, and for creating a CoffeeScript-based mobile salary-cutting ToDo app.

No. 2: Requirements tug-of-war
Credit: Ben Barbante
No. 2: Requirements tug-of-war

Event: Competitors face off in a requirements meeting trying to push as much work as possible onto each other.

Rules: Phrases that could otherwise be conveyed as acronyms will result in an obfuscation fault.

Scoring: The competitor who solicits the most opinions from department heads will receive a stakeholder bonus equivalent to three delegated tasks. Points will be deducted for failing to argue about server allocation, coming to a sensible agreement on APIs, or beginning any sentence with "It sounds like you're recommending that we…" without creating more work for the recommender.  

No. 3: The mobile app refactor
Credit: Ben Barbante
No. 3: The mobile app refactor

Event: Competitors take perfectly operable code that has been keeping customers happy for years on their PCs and rework the entire application to fit on a mobile screen.

Rules: No more than two buttons may be used per page, and one must be for tweeting the user's latest interaction with the app. Assuming access to a file system will result in an iPhone fault.

Scoring: Points will be added for fancy page flipping transitions regardless of whether the user gets lost in the new page maze. Points will be deducted for not locking user data into a proprietary cloud, or for failing to transform essential features into incremental, in-app upsell opportunities.

No. 4: The hot fix
Credit: Ben Barbante
No. 4: The hot fix

Event: Competitors are given buggy production code and a manager who is convinced they can fix it on the server without going through all of that testing rigamarole.

Rules: All bugs must be found and fixed without crashing the server.

Scoring: Corrections that do not modify at least four files will be discounted. Any modification that results in user data loss will result in disqualification. Bonus points will be awarded if event is completed using a terminal app on a mobile device while ordering drinks at a crowded bar.

No. 5: Writing comments for every function
Credit: Ben Barbante
No. 5: Writing comments for every function

Event: Competitors are given 14 modules consisting of 12 to 22 files, each with more than 100 lines of code with no comments, and a boss who read an article online that said badly commented code was costing the world economy trillions in lost productivity.

Rules: Every function must be commented even if the name of the function -- fahrenheit2Celcius -- describes it perfectly.

Scoring: Competitors whose commented code files, when printed out, do not weigh more than they do will be disqualified. Bonus points will be awarded for commenting incrementers and variable names. Points will be deducted for comments not written according to company specs locked in the boss's head.

No. 6: Social media makeover
Credit: Ben Barbante
No. 6: Social media makeover

Event: Competitors transform a perfectly functional website into a social media "platform," inserting Facebook "Like" buttons and Twitter icons into every last corner of every page on the site.

Rules: Failing to choose any arbitrary Web designer's favored version of any given icon for any given content block will result in a Look-and-Feel fault. JavaScript conflicts among third-party widgets may only be rectified using server-side scripting.

Scoring: Bonus points for customized text that encourages users to tweet they are being audited by the IRS when digging up a two-year-old invoices or to announce to Facebook friends that they have just purchased hemorrhoid medication. Points will be deducted if new social media widgets slow down page load times or fail to take things viral.

No. 7: SQL to NoSQL
Credit: Ben Barbante
No. 7: SQL to NoSQL

Event: Competitors are given a perfectly functioning SQL database, a boss who believes relational databases are so last millennium, and instructions to shoehorn the old SQL DB into a new, superfast NoSQL data store that's also superstripped down.

Rules: The NoSQL data stores must be assumed to have only two functions: Save and retrieve that take raw bits.

Scoring: Bonus points will be awarded for the creation of a homespun query language that anticipates every developer's needs. Points will be deducted for hinting at any schema other than what the application developers want to decide on any given version of their app.

No. 8: Reinventing the wheel -- in assembly
Credit: Ben Barbante
No. 8: Reinventing the wheel -- in assembly

Event: Competitors must create a homegrown Web server in assembler on the off chance that doing so will result in competitive edge.

Rules: Failing to test all inputs for buffer overflows in case someone is attacking will result in a Blockhead Fault.

Scoring: Bonus points will be awarded for using the fewest number of registers. Additional bonus points will be awarded if you remember what assembly registers are.

No 9: Big data profit toss
Credit: Ben Barbante
No 9: Big data profit toss

Event: Competitors transform a drive filled with 18 terabytes of log files into a magic algorithm that will make the company $1 billion in less than 10 minutes.

Rules: Algorithms must conform to the following structure: 1. Map; 2. Reduce; 3. Profit.

Scoring: Bonus points will be awarded for rewriting privacy policies to ensure maximum profits and minimal lawsuits in mining personal data. Points will be deducted for requiring more than the few spare servers heaped in with the vendor swag in the storage closet.

No. 10: Synchronized error throwing
Credit: Ben Barbante
No. 10: Synchronized error throwing

Event: In this extension of pairs programming, competitors and their partners solve a task list focused on trapping errors that might sneak through an API.

Rules: Partners must share the same keyboard and mouse. All errors, including malicious remote SQL injections and stack overflows, must be thrown back in a visually appealing way that the more pedantic of the computer scientists among us might label "isochronously."

Scoring: Clean code, concise comments, pointed toes: Perfect 10.