http://qs321.pair.com?node_id=459217


in reply to Homework question list

Slightly OT, but I've been interviewing long distance recently, and I used the following 3 questions tasks (ffs). Bear in mind these are for web application development, so front end is important too.

  1. create a calculator using HTML/Javascript, that processes the entered equation through a Perl CGI script and displays the result. This tests JS usage and, the biggie, whether they untaint user input in the CGI before 'eval'ing. Also, use of CGI/Mason/Template Toolkit is examined (and mentioned in the original question).
  2. Compare two arrays and show the elements that exist in both (I actually screwed up in my live question, but the answers were still informative). This is a great question because it shows how someone thinks. Lower level devs use nested loops (I did, when this was thrown at me a few years ago). Smart people use hash slices. Really smart people use 'undef'd hash slices to save memory (or, rather, time - ty runrig).
  3. Search google for a particular search term and present the first ten results in a web page. Another good one to see how someone thinks. LWP is quick and dirty, the Google SOAP Perl API is elegant, yet non-intuitive if you haven't heard of it.

Maybe we should start a quiz section where these sorts of questions can be dumped? I'm sure there are many more that push you to think laterally - or use aspects of Perl that involve some interesting thinking.

cLive ;-)