I have an interview coming up. I think I know jQuery and Javascript, but this interviewer is told to me to be quite tough. So, I want to read up on some of the things I might need to know.
In the last interview I had, they tended to draw some of their material from like recent articles on the popular programming tech sites like sitepoint.com, as well as where a lot of the buzz was over the past 2 years regarding a particular topic.
The Point -- So, do you have any suggested interview questions they might pose for me?
To help you here, I've come up with a few guesses, of which I already know the answers to the ones below:
1. What is a prototype? (And no, not the open source Prototype library for Javascript.)
2. What does the "each" property of jQuery provide?
3. (This interviewer doesn't have time for long drawn out answers, so this one might not work.) How might I use the "extend" property in jQuery, and more than just extending jQuery's features -- I mean, how would you go about using it?
4. Is the AJAX in your browser async or sync?
5. Why would I want the AJAX to be async vs. sync?
6. Name some things I can do with the colon operator in a jQuery selector.
7. How might I do a jQuery selector where I want to see if an HTML attribute contains something?
8. How many simultaneous connections can a browser have back to the server for XHTML requests? How many for AJAX requests?
9. What does .map() do in jQuery?
10. What is the difference between setTimeout() and setInterval() in Javascript?
And here's a list of others:
http://dev.fyicenter.com/Interview-Ques ... avaScript/
Javascript + jQuery Interview Questions
Moderator: General Moderators
-
jack_indigo
- Forum Contributor
- Posts: 186
- Joined: Sun Jun 08, 2008 11:25 pm
Re: Javascript + jQuery Interview Questions
If I would be an interviewer I probably would ask also these (they all are about speed):
JSON vs XML, which and why?
To change elements visual appearance which you would use .css(...) or .addClass(...) and why?
jQuery selectors: CSS3 selectors, performance (which are faster, which are slower).
What's a 'reflow' and how to avoid it or minimize its impact (how to make sure it runs as fast as possible)?
JSON vs XML, which and why?
To change elements visual appearance which you would use .css(...) or .addClass(...) and why?
jQuery selectors: CSS3 selectors, performance (which are faster, which are slower).
What's a 'reflow' and how to avoid it or minimize its impact (how to make sure it runs as fast as possible)?
-
jack_indigo
- Forum Contributor
- Posts: 186
- Joined: Sun Jun 08, 2008 11:25 pm
Re: Javascript + jQuery Interview Questions
Thanks, kaszu
-
jack_indigo
- Forum Contributor
- Posts: 186
- Joined: Sun Jun 08, 2008 11:25 pm
Re: Javascript + jQuery Interview Questions
1. JSON vs XML, which and why?
I'd say JSON when parsed on the Javascript side because it's already in a format you can plug in to an associative array and get at elements through indices, whereas XML must still be parsed. From the server-side, either does not matter anymore because PHP has C-based libraries available to parse each at high speed.
2. To change elements visual appearance which you would use .css(...) or .addClass(...) and why?
I don't know the answer to that one. At a guess I'd say addClass because all the properties are parsed and assigned to the class, whereas the .css would have to be interpreted one at a time.
3. jQuery selectors: CSS3 selectors, performance (which are faster, which are slower).
CSS3 selectors are not possible in the older IE browsers, so the only way to access them would be inside jQuery selectors. So, if you use CSS2 and prior type selectors inside jQuery, it can access the item via regular browser calls, I'd say. But with CSS3, it must emulate it for now until all the browsers support CSS3 type selectors.
4. What's a 'reflow' and how to avoid it or minimize its impact (how to make sure it runs as fast as possible)?
I had never heard of that. I had to Google it and found:
http://www.mail-archive.com/dev-tech-la ... 00531.html
So, basically when doing Javascript changes to a page, a reflow means that you're doing a change that causes the entire page to have to be rescanned and adjusted again, I guess. I wonder how I can know that a browser is having to conduct a reflow? Is that a Firebug setting to see that?
Anyway, in the link above, the person found they could hide the item, make the changes necessary to it, and then show it again in order to avoid the reflow. But then said his trick didn't work in Firefox.
I guess I need to know what tasks would trigger reflow in the various browsers.
I'd say JSON when parsed on the Javascript side because it's already in a format you can plug in to an associative array and get at elements through indices, whereas XML must still be parsed. From the server-side, either does not matter anymore because PHP has C-based libraries available to parse each at high speed.
2. To change elements visual appearance which you would use .css(...) or .addClass(...) and why?
I don't know the answer to that one. At a guess I'd say addClass because all the properties are parsed and assigned to the class, whereas the .css would have to be interpreted one at a time.
3. jQuery selectors: CSS3 selectors, performance (which are faster, which are slower).
CSS3 selectors are not possible in the older IE browsers, so the only way to access them would be inside jQuery selectors. So, if you use CSS2 and prior type selectors inside jQuery, it can access the item via regular browser calls, I'd say. But with CSS3, it must emulate it for now until all the browsers support CSS3 type selectors.
4. What's a 'reflow' and how to avoid it or minimize its impact (how to make sure it runs as fast as possible)?
I had never heard of that. I had to Google it and found:
http://www.mail-archive.com/dev-tech-la ... 00531.html
So, basically when doing Javascript changes to a page, a reflow means that you're doing a change that causes the entire page to have to be rescanned and adjusted again, I guess. I wonder how I can know that a browser is having to conduct a reflow? Is that a Firebug setting to see that?
Anyway, in the link above, the person found they could hide the item, make the changes necessary to it, and then show it again in order to avoid the reflow. But then said his trick didn't work in Firefox.
I guess I need to know what tasks would trigger reflow in the various browsers.
Re: Javascript + jQuery Interview Questions
Hi everybody,kaszu wrote:If I would be an interviewer I probably would ask also these (they all are about speed):
JSON vs XML, which and why?
To change elements visual appearance which you would use .css(...) or .addClass(...) and why?
jQuery selectors: CSS3 selectors, performance (which are faster, which are slower).
What's a 'reflow' and how to avoid it or minimize its impact (how to make sure it runs as fast as possible)?
I uploaded one file. But It can not display. I used internet explorer 8.0.
How can I repair? Or some problems happened to IE8?
Rgs
Re: Javascript + jQuery Interview Questions
You'd be mistaken here. jQuery uses Sizzle css selector engine which does not rely on browser support for css selectors.jack_indigo wrote: 3. jQuery selectors: CSS3 selectors, performance (which are faster, which are slower).
CSS3 selectors are not possible in the older IE browsers, so the only way to access them would be inside jQuery selectors. So, if you use CSS2 and prior type selectors inside jQuery, it can access the item via regular browser calls, I'd say. But with CSS3, it must emulate it for now until all the browsers support CSS3 type selectors.