[jQuery] HELP: Screening questions for JavaScript developer candidates:
<p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 11.0px Times"><b>(required) Q: </b>Describe the difference in result of the JavaScript DOM methods getElementById and getElementsByClassName.
<p style="margin: 5.0px 0.0px 5.0px 36.0px; font: 11.0px Times"><b>2. (required) </b>Given this JavaScript statement:<span style="font: 11.0px Lucida Grande">
<b>
</b></span><b> objXHR.open('GET',</b><span style="text-decoration: underline ; color: #0000ff"><b>' HYPERLINK "http://" <a href="http://myURL.com">http://myURL.com</a>',true</b></span><b>);</b><span style="font: 11.0px Lucida Grande"><b>
</b>
</span> a.<b> Q:</b> What, probably, is the type of the object named "objXHR"?
<p style="margin: 5.0px 0.0px 5.0px 36.0px; font: 11.0px Times"> b.<b> Q: </b>What is the purpose of each of the parameters being passed to the "open" method?
<p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 11.0px Times"><span style="font: 11.0px Lucida Grande">
</span><b>Q: </b>If an absolute URL is passed in the second argument, what kind of restriction <i>usually </i>applies?
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Times"> <span style="font: 11.0px Lucida Grande">
</span><b> 3. (required) </b>How would you <b>(a) </b>declare and then <b>(b) </b>instantiate a JavaScript class to describe a "Square" object, taking one argument in its constructor? The instance of a Square should have sides 4 units in length. <b>( c )</b>What properties might a Square object have and how would they be coded?<span style="font: 11.0px Lucida Grande">
</span> <b>a.</b> declare: function Square(numericSideArgument) {<span style="font: 11.0px Lucida Grande">
</span> ... (some other stuff)<span style="font: 11.0px Lucida Grande">
</span> }<span style="font: 11.0px Lucida Grande">
</span> <b>b.</b> use: var mySquare = new Square(4);<span style="font: 11.0px Lucida Grande">
</span> <b>c.</b> methods: <b>perimeter</b>, coded as "this.perimeter = numericSideArgument * 4;"<span style="font: 11.0px Lucida Grande">
</span> <b>area</b>, coded as "this.area = numericSideArgument ^ 2;" (squared, i.e. width * height) <span style="font: 11.0px Lucida Grande">
</span> So, the whole definition of Square would be:<span style="font: 11.0px Lucida Grande">
</span> function Square(numericSideArgument) {
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Times"> this.perimeter = numericSideArgument * 4;<span style="font: 11.0px Lucida Grande">
</span> this.area = numericSideArgument ^ 2;<span style="font: 11.0px Lucida Grande">
</span> return this;
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Times"> }<span style="font: 11.0px Lucida Grande">
</span> So, <b>Q: </b>"mySquare.perimeter" would equal?
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Times"> <b>Q: </b>"mySquare.area" would equal <b>?</b><span style="font: 11.0px Lucida Grande">
</span><b> 4.</b> <b>(desired) </b>An object called "auto" has an "id" attribute with value of "taurus" and a "color" attribute with value "blue". Additionally, it has a child object "radio", which contains an array "knob" which contains three items with names and shapes:
<p style="margin: 5.0px 0.0px 5.0px 0.0px; font: 11.0px Times">name: power, shape: round
<p style="margin: 5.0px 0.0px 5.0px 0.0px; font: 11.0px Times">name: tune, shape: oval
<p style="margin: 5.0px 0.0px 5.0px 0.0px; font: 11.0px Times">name: scan, shape: square
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times New Roman; min-height: 15.0px">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Times"><b>Q: </b>What does the acronym JSON stand for? <span style="font: 11.0px Lucida Grande">
</span><b>Q: </b>What does this object look like in JSON?
<p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 12.0px Times New Roman; min-height: 15.0px">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Times"><b> BONUS 5.</b> <b>(CSS-related)</b> Describe the difference between a <DIV> element versus a <SPAN>.
<p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 11.0px Times; min-height: 13.0px"><b></b>
<p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 11.0px Times"><b> BONUS 6.</b> <b>(Advanced JavaScript and YUI)</b> If I have a JavaScript collection object "YAHOO.util.Dom" with a member method "setStyle" that takes three arguments
<p style="margin: 5.0px 0.0px 5.0px 0.0px; font: 11.0px Times">"an array of element id's"
<p style="margin: 5.0px 0.0px 5.0px 0.0px; font: 11.0px Times">"a css property name", and
<p style="margin: 5.0px 0.0px 5.0px 0.0px; font: 11.0px Times">"a single float value",
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Times"><span style="font: 11.0px Lucida Grande">
</span>...<b>Q: </b>how would I write the <b>single </b>line of JavaScript that sets the transparency of DIV's "layer1" and "layer2" to "66%"?
<p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 11.0px Times"><span style="font: 11.0px Lucida Grande">
</span> <b>Q:</b> How would I write the single line of JavaScript that sets the background color of only DIV "layer1" to hexadecimal "black"?<span style="font: 11.0px Lucida Grande">
</span> <b>Q: </b>If there was another method which DID take a single-value, non-array, in that first argument, in object-oriented terminology, the method would be said to be "what"?<span style="font: 11.0px Lucida Grande">
</span> <b>Q: </b>Does JavaScript support overloading?<span style="font: 11.0px Lucida Grande">
</span> <b>BONUS 7:</b> <b>(Super-impressive)</b> <b>Q: </b>Can you summarize the definition of "JavaScript enclosures"?
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times New Roman; min-height: 15.0px">