You are viewing an archive of a past, completed Coding Challenge. Click here for the current Contest.

Coding Challenge

Use the latest HTML5 technology to build a small web application that solves the following concurrency problem.


Updates

The 2016 RDE Coding Challenge is over. Thanks to everyone who submitted an entry. Congratulations to our winners!

  • [0th place / Grand Prize] Siddharth Shah
  • [1st place] Devang Sinha
  • [2nd place] Tushar Sharma

The Problem

In a typical records-based web application, a single record may be edited by multiple users at the same time. This produces a classic concurrency problem: a race condition.

Suppose there is a classic data entry form for editing an existing record. User A loads the page to begin editing a record. Before User A saves the form, User B loads the same form containing the same data. Now suppose User A and User B decide to edit two different fields in the same form. If User B saves first, then when User A saves, User B's changes will be lost because User A will be saving "over" the new data updated by User B.

Here's an example timeline showing how it can go wrong:

Graphic demonstrating race condition

The result of this sequence of events will result in the User A saving the old value for the firstname alongside the new DOB, overwriting User B's changes.


How do we solve this?

The same way we deal with most other simple concurrency problems – with locking! When two users are editing the same record at the same time, use a lock to stop them from editing a field at the same time. If User A starts editing a field, disable that field for User B until User A is finished, and then display the newly saved value when the lock is released and editing is re-enabled for User B.

This is complicated by the client-server model. Web browsers cannot simply access a memory location like two processes on a multi-threaded operating system. Events must be sent to the web browser via server push to tell users when a field gets locked or unlocked. We'd like you to use HTML5 technologies, either Server-Sent Events or WebSockets, for sending events between browsers and the server.

The Official Contest Rules and Detailed Specifications were published on 2/10/2016. You must upload your source code by 3/1/2016.


Requirements

  1. Permissible Languages. Submissions must be coded using one of the following server-side languages:
    • PHP
    • Python / Django
    • Node.js / io.js
    • JSP / Java under Apache Tomcat
    • Ruby / Ruby on Rails
    • ASP .NET: VBScript, C# or JScript
    • Coldfusion (CFML)
  2. Permissible Relational Databases. Submissions must use one of the following Relational Databases to store client data:
    • MySQL
    • PostgreSQL
    • Microsoft SQL Server (Express Edition)
  3. Submissions may not utilize browser plugins. Submissions utilizing browser plugins will be disqualified. For more information, see the Detailed Specifications.
  4. Submissions must be the work of a single individual. Submissions which represent the work of more than one individual, or which are submitted by a single individualon behalf of a team of two or more, will be disqualified.
  5. Submissions must be received by the deadline, March 1, 2016, 23:59:59 EST. Submissions for which the upload is not complete by March 1, 2016, 23:59:59 EST (or in the case of submissions which are made via US postal mail, which have not been received by March 1, 2016, 23:59:59 EST), will be disqualified.

Official Contest Rules and Detailed Specifications

Please read the Official Rules and Specifications document at http://rde.org/codingchallenge/2016spring/rules.pdf

Submit Your Entry

Submission procedure:

  • A submission will be a single zip file with six components:
    1. The source code for your solution, in its own subfolder. All code must be in plaintext, ASCII or UTF-8 encoded. Images and other documents are allowed, but any submissions including compiled executable code will be disqualified.
    2. A database definition script, written in SQL. This script will contain CREATE TABLE statements and, if necessary, other database object creation commands and INSERT statements. The entire database setup should be completed by running this script.
    3. A file describing the setup process in simple step-by-step instructions, named “setup-instructions”. This may be a text file (setup-instructions.txt), Microsoft Office Word Document (setup-instructions.doc or setup-instructions.docx), Open Document format (setup-instructions.odt), or PDF (setup-instructions.pdf).
    4. A contact information file, containing your full name, mailing address, date of birth, state of legal residence, and a statement that your submission is your original work.
    5. Optionally, if you wish to be considered for an internship, you may include your resume in the zip file.
    6. Optionally, a visual presentation in the form of a slideshow, no more than 30 slides, or a video, no more than 10 minutes long, describing and demonstrating the features of the application, including any additional features not in specs. Slideshows must be a Microsoft Office Powerpoint file (.ppt or .pptx), or an Open Document Presentation file (.odp). Videos must be in one of the following compressed formats: MPEG-4 (.mp4), Audio Video Interleave (.avi), Ogg Video (.ogv or .ogg), Windows Media Video (.wmv), Quicktime (.mov or .qt), or Matroska (.mkv).
  • The submission zip file must be no larger than 100 MB. If your solution requires external libraries that take up a lot of space, do not include them in the text file, but add instruction steps giving the URL where they can be downloaded, and describe where to put the external library files within the directory structure.
  • There are two allowed methods of transferring your zip file to RDE.
    1. Upload your submission via the Official Entry Form below.
    2. Burn the zip file to a CD or DVD disc and send it, along with a printed Official Entry Form, via US Postal Mail to:
      220 Scoles Avenue
      Clifton, NJ 07012
  • Submissions uploaded via the Official Entry Form must be received by the submission deadline, March 1, 2016, 23:59:59 EST.
  • Submissions sent by mail must reach RDE by the submission deadline, March 1, 2016, 23:59:59 EST.
  • Submissions received via any other means will not be accepted.
  • You may revise your entry and resubmit it as many times as you like. The last submission we receive from you before the deadline will be the only one used in judging.
As of March 2, 2016, the Contest is closed and we are no longer accepting submissions. Results will be available May 10, 2016.

Completed Contests

Prizes

0th place / grand prize$500
1st place$200
2nd place$100

Prizes will be in the form of an Amazon.com gift card.

All contestants will be considered for an RDE Internship.

Schedule

Feb. 10, 2016
Detailed Specification Release and Contest Start

Mar. 1, 2016
Submission Deadline

Why is RDE sponsoring this?

RDE wants to get to know programmers who naturally enjoy a good challenge and like to go above-and-beyond in all that they do. This is a good opportunity for great programmers to get to know RDE and why we're special.

Click here to learn about our special partnership with NJIT.


Flyer

Coding Challenge Flyer