So you think you wanna be a web developer... Fork [https://gist.github.com/3788769](https://gist.github.com/3788769) and update your copy with answers. They don't need to be precise - pseudo-code is fine in most cases. Some questions don't have correct answers. Submit your answers to ara@dojo4.com FROM: you@yeraaddy.com SUBJECT: [dojo4-quiz] quiz-1 BODY: https://gist.github.com/to-your-submission
ref: https://gist.github.com/3788769
1. is this broken in html5? if so why?
\<div id='teh\_javascripts' /\>
teh answerz...
2. write an http GET request for the url
'http://domain.com:4242/foo/bar/baz.html'
teh answerz...
3. in any language you choose, write this to run in parallel
numbers = 20, 1results = []numbers.each do |number|results.push( parallelize{ number \* 2 } )endsum = reduce( results )
teh answerz...
4. in any language you choose, write this to run in parallel on multiple cores
numbers = 20, 1results = []numbers.each do |number|results.push( parallelize{ number \* 2 } )endsum = reduce( results )
teh answerz...
5. is this broken in html5?, why?
\<label for='user.email'\>\<input name='user.email'\>
teh answerz...
6. what is value of 'status'
if @not\_modifiedrender :status =\> statusend
teh answerz...
7. is this javascript broken? if so, why?
var submit = document.getElementById("submit");submit.click();
teh answerz...
8. which is better? why?
\<!-- A --\>\<table\>\<tr\>\<td class='key' style='width:33%'\> {{ dynamic\_content\_for(:key) }} \</td\>\<td class='val'\> {{ dynamic\_content\_for(:val) }} \</td\>\</tr\>\</table\>\<!-- B --\>\<div class='fluid grid'\>\<div class='row'\>\<span class='key width33'\> {{ dynamic\_content\_for(:key) }} \</span\>\<span class='val'\> {{ dynamic\_content\_for(:val) }} \</span\>\</div\>\</div\>
teh answerz...
9. which is better? why?
# Aif var == 42"..."end# Bif 42 == var"..."end
teh answerz...
10. describe steps to debug this problem
@response =http\_request(url, :method =\> method, :params =\> params, :headers =\> headers)if @response.ok?ship\_it!elsedebugger!end
teh answerz...
11. which is better? why?
# Aif foo.bar.baz'...'end# Bif fooif foo.barif foo.bar.baz'...'endendend
teh answerz...
12. is this javascript broken? if so, why?
ajax(url)({'method': 'POST','params': params,'headers' : headers});
teh answerz...
13. what color is this?
'#FFE'
teh answerz...
14. what number is this?
0b101010
teh answerz...
15. describe an algorithm to detect the 'edges' in these pixels
0 0 0 0 0 0 0 0 1 1 1 0 0 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0
teh answerz...
15. what does @X represent?
$color = [@X, @R, @G, @B].as\_hex
teh answerz...
16. what are the advantages of static linking?
export HINT=$LD\_RUN\_PATH
teh answerz...
17. wtf is this javascript doing?
var uploader = new qq.FileUploader(options);var image\_ids = [];uploader.\_uploadFileList = function(){image\_ids = [];var args = Array.prototype.slice.call(arguments);var result = qq.FileUploaderBasic.prototype.\_uploadFileList.apply(uploader, args);return(result);};
teh answerz...
18. what does this code do?
jQuery('.help').find('a').attr('tabindex', '-1');
teh answerz...
19. how would you solve this problem?
~ \> run\_api\_tests\_locally "FAIL: you must access teh API from a box on EC2 with IP 1.2.3.4!"
teh answerz...
20. which is better? why?
// AUser.prototype.first\_name = function(){return this.name.split(/\s+/)[0];};// BUser.prototype.first\_name = function(){return User.first\_name\_for(this.name);};User.first\_name\_for = function(name){return name.split(/\s+/)[0];};
teh answerz...
Tweet