Back in the day when the World Wide Web wasn’t too worldwide, finding solutions to coding problems was quite a pain. These days it is possible stack together pieces of code from stackoverflow and out comes a somewhat working app you can call your own. It’s for reasons like this we decided to give the candidates who applied for our developer roles a little test. They had three questions with the freedom to pick and verbally solve only one of the three questions. These questions are quite trivial but differentiate the copy and paste developers from the real ones.
Question 1: List of employees
We have a webpage that has just a single text box with a plus icon next to it. Clicking on the + icon creates duplicates of the text box. The user can click the + icon as many times as they want to keep adding text boxes. This is the code that created the text box
<input type=”text” placeholder=”Enter name:” name=”fullname” />
Question 2: The YouTube Videos Headache
We have this static webpage that displays videos embedded form YouTube. On the page we have a big black box that spans the width of the page and is 500px in height. Just beneath that box are several videos embedded from YouTube but displayed at thumbnail size. Unfortunately, the thumbnail sized videos begin to play if we click on any of them. Well that’s how YouTube embedded videos behave. We don’t want that. We want any video clicked on to play ONLY in the big black box.
Question 3: SQL params error
params = "123ABC, 32ED9, 983HGI, UU843, 101ZX"SELECT nickname, orgasms FROM bangs WHERE id IN (params)
The above query when executed generates an error. SQL expects the value of params to be in the format below
params = "'123ABC', '32ED9', '983HGI', 'UU843', '101ZX'"
Your task, using the most efficient method, is to ensure params is formatted with single quotes before being passed to the SQL query.
You can tell the above tasks are nothing Herculean, just simple enough to help test how the candidates reason around problems. The ability to reason around a problem is something copy and paste developers lack. You can attempt to answer the above questions to see if you’re getting rusty as a developer :)