tag:blogger.com,1999:blog-34454975.post3663110628940273135..comments2023-06-28T16:58:41.189+02:00Comments on Web Reflection: The Rebecca Murphey's ChallengeAndrea Giammarchihttp://www.blogger.com/profile/16277820774810688474noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-34454975.post-87293019213480671642010-10-03T14:40:25.215+02:002010-10-03T14:40:25.215+02:00nice one ... but dude, you are late :Dnice one ... but dude, you are late :DAndrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-26134120778021035732010-10-03T14:18:20.972+02:002010-10-03T14:18:20.972+02:00Seems to be more readable and requires less commen...Seems to be more readable and requires less comments then yours :)<br /><br />var date = +new Date,<br /> timeSpan = 1000*60*60*24, // milliseonds in the day<br /> dates = [];<br /><br />for (var i = 1; i <= 5; i++) {<br /> var nextDate = new Date(date + i * timeSpan);<br /> dates.push(nextDate.getMonth() +1 + '/' + nextDate.getDate());<br />}<br /><br />console.log('The next five days are ', dates.join(', '));Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34454975.post-69207018208596171542010-09-16T18:09:27.512+02:002010-09-16T18:09:27.512+02:00You missed the point of almost al my answers so we...You missed the point of almost al my answers so we agree on disagree.<br /><br />#3 nothing to worry about in my shoed example ... what you prefer is unconditional choice while I prefer to chose the best way accordingly with what I need for that task.<br /><br />__proto__ was a simplified description, not part of the solution indeed but simply part of the explanation. Why bother about it?<br /><br />#3.3 all about examples, you probably know this as well<br /><br />#4 you are right but I have described possible assumptions for a more abstract destroy<br /><br />#5 fails for what? on #4 you say I don't need to check and now you invented a test that does not exist? Have you checked the link I have provided?<br /><br />#7 again ... ASSUMPTIONS? Thanks to underline again the whole point I made with this post :-)<br /><br /><br />#9... Readibility is key ... where is it written? The very first question is about making it less readable ... and you decided that is the key for the 9th?<br />You simply confirmed one more time what I have said, you have to make lots of assumptions ... I start thinking you did not read my post at all, you rather went through examples and nothing else ...<br /><br /><br />#10 that is your answer ( easy level ) mine goes into details ... sorry you screwed up this one ;-)Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-34037601450117793782010-09-16T11:04:13.563+02:002010-09-16T11:04:13.563+02:00#3 I prefer anonymous function expressions to name...#3 I prefer anonymous function expressions to named expressions or even declarations. They prevent hoisting for one and also possibly prevent legacy implementation fuckups with named expressions. And you'll never make the mistake (yes, mistake) of a function declaration inside another statement :)<br /><br />__proto__ and the likes are not standard. Asside from the complexities of understanding prototype vs [[Prototype]], they're simply not guaranteed to work. Do not "need" them.<br /><br />#3.3 overwrites the entire prototype object, which can hardly be desired. But you probably know this.<br /><br />#4 is clearly just asking for a for..in loop that destroys, where you may assume destroy exists (so why check anyways?).<br /><br />#5 fails for anything that's not a string. Array.prototype.concat.apply([], arr.map(function(x){ return [x,x,x];})); is one of undoubtfully many approaches.<br /><br />#7 it does not matter what framework xhrGet belongs to. All that matters is whether xhrGet will call the load method of the object passed on _before_ it returns. Also, your fix does not necessarily fix the problem because you don't know what "important stuff" does. Maybe it's an init-once kind of thing ;)<br /><br />#9 that's improvement? I'd rather have the original... or maybe something like the following. Readibility is key.<br /><br />for (i = 0; i <= 100; i++) {<br /> var pre = '< p>< span class="';<br /> var mid = '">i am ';<br /> var post = ' '+i+'';<br /><br /> $('#thinger').append(pre+'thinger'+mid+'thinger'+post);<br /> $('#gizmo').append(pre+'gizmo'+mid+'gizmo'+post);<br />}<br /><br />#10 dude... the answer is simply that the + operator is overloaded. If the user input is not converted to number the result is a string, period. Otherwise the result is a number, NaN (okay, technically still a number). I don't think this was about security at all.<br /><br />I think I'm with Rebecca on this one, you kind of missed the point :)Peter van der Zeehttp://qfox.nlnoreply@blogger.comtag:blogger.com,1999:blog-34454975.post-20081456576352129752010-09-16T10:27:00.141+02:002010-09-16T10:27:00.141+02:00Oh my, another one of those tests/quizzes. Yawn......Oh my, another one of those tests/quizzes. Yawn... Still thanks for your detailed answer :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34454975.post-14680385625756016272010-09-16T02:30:47.033+02:002010-09-16T02:30:47.033+02:00Alex S really valid points and apparently Rebecca ...Alex S really valid points and apparently Rebecca already discarded me :D<br /><br />The problem with quizzes, specially with technical ones, is that the "candidate" would never disturb or ask too much to avoid feeling not prepared or not good enough for the role ... but why should the "candidate" be abandoned due lack of info or, in the worst case scenario, in front of a quiz written by somebody that did some mistake?<br /><br />I am sure Rebecca put a lot of things on purpose, but I still wonder why, being the gist way something "cold", without any interaction, something that does not provide any extra answer and all the candidate would like to do is to do it properly.<br /><br />You are right there is no "customer" able to tell you details but being there means you know the company or what the company is doing ... you are already oriented for that kind of role.<br /><br />Which one is the role here? A JS chap? Somebody that knows different libraries? It's not clear, can I ask this face to face? I cannot!<br /><br />About the business case, I simply try to be myself as much as possible and since this is the blog where I rant 99% of the time against everything, I thought Rebecca wouldn't have been offended and, if so, my apologies, I was simply evaluating the test from a *non* *interested* point of view, as I have found it on the road 'cause somebody left it there (nobody for clarifications, a lonely piece of paper with questions).<br /><br /><i>Further, if she can't assume a framework is available, why do you get to decide to use the not-always-compatible array map function? Seems like the same issue.</i><br />Not really, for me <a href="http://code.google.com/p/vice-versa/" rel="nofollow">vice-versa</a> offers many functionalities PrototypeJS does, and I consider it my JavaScript framework where Array.prototype.map is there, as it would be if I chose another one.<br /><br /><i>Anyways, I appreciate the technical knowledge of this post, but ultimately feel like you just plain missed the point.</i><br />Probably yes, and thanks for your comment.<br />Thanks Rebecca as well that commented via twitter.<br /><br />RegardsAndrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-19376788752564826652010-09-16T01:47:23.951+02:002010-09-16T01:47:23.951+02:00I think a lot of the value of the original quiz, w...I think a lot of the value of the original quiz, was that it wasn't defined exactly for the same results, and it had some ambiguity in it. I'm not sure which clients that you have worked with, but none of them let me know whether I'm going for speed or memory management.<br /><br />Also, you got angry at her for assuming a framework in some cases. While it's obviously silly to have a framework for simple little questions like this, the work that she is likely looking to hire someone for is much more complex, and uses a framework. It is wise of her to test people's knowledge of these frameworks.<br /><br />You have exquisite detailed answers, but you've effectively berated the client, and they'd likely fire you. You failed the business case.<br /><br />I understand that you took this as somewhat of a JavaScript Quiz, but the _clear_ intention wasn't to find out someones precise ability to find holes in the questions. It was to find someone's ability to work well alongside her team. This was not a Kangax JS Test, this was a set of interview questions.<br /><br />Further, if she can't assume a framework is available, why do you get to decide to use the not-always-compatible array map function? Seems like the same issue.<br /><br />Anyways, I appreciate the technical knowledge of this post, but ultimately feel like you just plain missed the point.Alex Shttps://www.blogger.com/profile/13960732063937121643noreply@blogger.com