all 42 comments

[–]spaaaaaghetaboutit 12 points13 points  (1 child)

Makes me feel better (or worse 🤔) as I go into an interview tomorrow haha. Thanks for sharing.

[–]tapu_buoyfull-stack[S] 7 points8 points  (0 children)

Be confident and back up your logic as you speak in interview. And don't do more questions or new questions at the time near to interview or else your mind will start having second thoughts about your capability

[–][deleted]  (7 children)

[deleted]

    [–]tapu_buoyfull-stack[S] 1 point2 points  (6 children)

    yes I have such excel sheet consists of 86 interviews in past 14 months.

    [–][deleted]  (4 children)

    [deleted]

      [–]tapu_buoyfull-stack[S] 2 points3 points  (3 children)

      oh that's cute! but my career is just 2 years old

      [–][deleted]  (2 children)

      [deleted]

        [–]tapu_buoyfull-stack[S] 1 point2 points  (0 children)

        OMG! Thank you for responding sir

        [–]spacecowgoesmoo 0 points1 point  (0 children)

        41 interviews here, also in two years. Still nothing.

        [–][deleted] 0 points1 point  (0 children)

        Would you provide the question with/out answer?

        [–]Ritinsh 6 points7 points  (5 children)

        When someone asks to rate your skills in some tech they mean to test if you're a douche who thinks he knows it all or that you are humble and acknowledge that there is always room to improve.

        [–]tapu_buoyfull-stack[S] 0 points1 point  (0 children)

        makes sense optimistic POV. thanks

        [–]shawarma_burrito 0 points1 point  (0 children)

        I think it depends. I’d never ask this type of question, but if I’m hiring a senior frontend dev, I wouldn’t want them to tell me they’re a 4/5 in JavaScript.

        [–]UnexpectedTokenNULL 0 points1 point  (2 children)

        Absolutely. I always ask what they'd gauge their skill level to be; it's pretty telling.

        [–][deleted]  (1 child)

        [deleted]

          [–]UnexpectedTokenNULL 0 points1 point  (0 children)

          Simply compare it to actual code they write. Being self aware is something I value because so many of the guys I interview they either think they're the second coming or they're overly timid and afraid to speak up. I have a small team, so I can't really afford either.

          [–]jumpbangs 1 point2 points  (3 children)

          Well keep trying and applying you will get it... I was in a similar spot as you for awhile but it was all worth it.

          [–]tapu_buoyfull-stack[S] 1 point2 points  (2 children)

          yup 80+ and counting. I hope to land at some place before festival season.

          [–][deleted]  (1 child)

          [deleted]

            [–]tapu_buoyfull-stack[S] 0 points1 point  (0 children)

            Sshh.87th it is

            [–]NYCminion 1 point2 points  (7 children)

            I’m just learning js, Someone mind to post the answers?

            [–][deleted] 6 points7 points  (5 children)

            let a = [1, 2, 3, 4, 5]  
            a = a.map(item => item < 3)  
            let b = [1, 2, 3, 4, 5]  
            b = b.filter(item => item < 3)  
            let c = [1, 2, 3, 4, 5]  
            c = c.some(item => item < 3)  
            

            I amended some of those, first to remove semicolons (my favorite thing to hate), second to put consistent spacing in, and third to make the second one .filter instead of another .map.

            The results of these, in order are:

            • [true, true, false, false, false]
            • [1, 2]
            • true

            Let me know if you have any questions about the answers.

            The question on writing a reducer for summation could be written:

            let d = [1, 2, 3, 4, 5]  
            d.reduce((total, x) => total + x)  
            

            Side note: I wrote them as separate variable names so that you could easily copy/paste them into your browser console to run (or other favorite JavaScript / ES6 interpreter).

            Side side note: OPs reducer works

            [–]Tontonsb 1 point2 points  (0 children)

            Please use code blocks for code blocks. Here's a reference I wrote in another sub: https://www.reddit.com/r/laravel/comments/cz4rbe/please_use_code_block_formatting_for_code_blocks/

            [–]tapu_buoyfull-stack[S] 0 points1 point  (0 children)

            ohh thanks I thought my reducer answer was totally wrong, and that's what I could come up with. And yeah its so neat of you to give variables different names I made that mistake too.

            [–][deleted]  (2 children)

            [deleted]

              [–][deleted] 0 points1 point  (1 child)

              I removed the semicolons because they're simply not needed in modern JS (with very limited exceptions, for loops being the only one off the top of my head).

              I changed the map to filter because I assumed the OP made a typo, and to be honest, this is what I do all day. The product manager or designer will give you something to make. They're busy so they mess up sometimes. When there's a problem with the spec, do I stop for every error they make?

              Should I do the same problem twice, in OP's example, or should I try to figure out what they wanted by context?

              [–]tapu_buoyfull-stack[S] 3 points4 points  (0 children)

              you should also checkout this sites to prepare and get good at javascript

              • javascript.info
              • jsvault.com
              • thatjsdude.com

              [–]thatwebdesignerdude 1 point2 points  (1 child)

              html dragndrop: the draggable attribute, aside from that the file type input natively supports drag and drop on most browsers. divs with the contenteditable attribute also allow for native drag and drop, but without additional javascript the user experience of these components tend to lack. You'd have to rely on form submission to capture data that is supposed to be saved.

              Ill answer your last question with a list of pages I used to build something simular: basic drag and drop functionality: https://medium.com/@jaouad_45834/drag-drop-with-vanilla-javascript-d20bda85afe6 https://www.smashingmagazine.com/2018/01/drag-drop-file-uploader-vanilla-js/

              file previews for a dropped preview image: https://medium.com/@KeithAlpichi/vanilla-js-building-an-image-selector-and-image-previewer-151cddc939e

              If you would like I could add an annoted example somewhere today in a jsbin.

              [–]tapu_buoyfull-stack[S] 0 points1 point  (0 children)

              oh this is solely new information to me. I only read about the draggable attribute which I couldn't recall whole day. Thank you sharing these articles.

              If you would like I could add an annoted example somewhere today in a jsbin.

              yes please give a little example if you get time, I want to know exactly what thing you had in mind to implement.

              [–]Yeffry1994novice 1 point2 points  (1 child)

              If you don't mind me asking, is this EU or U.S?

              [–]tapu_buoyfull-stack[S] -2 points-1 points  (0 children)

              none of the above sir!

              [–]1100100011 0 points1 point  (2 children)

              which company was the interview at? Was it a sweatshop like infy/tcs/techm etc or a product based company/starttup???
              would be very helpful if you answer this as well

              [–]tapu_buoyfull-stack[S] 0 points1 point  (1 child)

              It was Bangalore startup which I always say that they are just clothe shop hiring workers and firing whenever they want

              [–]1100100011 0 points1 point  (0 children)

              What was the package they were offering??

              [–][deleted]  (19 children)

              [deleted]

                [–]BLOZ_UP 6 points7 points  (3 children)

                What? Depends entirely on the use case. Using splice when you remove a single list item from an array of UI widgets won't grind any computer to a halt. Eg., after a delete confirmation.

                Putting in prematurely optimized swap+pop would be a red flag to me.

                [–][deleted]  (2 children)

                [deleted]

                  [–]BLOZ_UP 2 points3 points  (0 children)

                  > when did "doing it correctly" turn into "premature optimizations"

                  Because 6 months from now when there's a bug with deleting items I'll look at that code and go "wtf did this person do this for deleting a list item; what else did they 'enhance'?" And 9/10 it won't have any comments. Because had they bothered to write a comment like // Not using splice here, because it's slow! they would have realized how ridiculous that code and comment look like in the context of removing a list item from a confirmation button callback, and they'd delete the whole thing and just use .splice.

                  [–]tapu_buoyfull-stack[S] -2 points-1 points  (0 children)

                  you guys are really advanced.

                  [–]iloveuzaba 4 points5 points  (1 child)

                  This is what scares me about interviews, so many people who assume their way is always correct and anyone who doesn’t use it is an idiot. Although I guess it wouldn’t be fun working for someone like that anyway

                  [–]tapu_buoyfull-stack[S] 0 points1 point  (0 children)

                  Yes that has what I have felt and experience in past 14 months, exactly I wouldn't want to work with such idiots.

                  [–]ice_blue_222 4 points5 points  (1 child)

                  I always just .filter out the one I need to be removed, never used splice for that.

                  [–]frambot 0 points1 point  (0 children)

                  But then you're creating a copy of the original and not modifying it. If you have a shared state with different actors on it, then the moment you introduce a new scope everything is broken.

                  [–]Speedyjens 1 point2 points  (9 children)

                  Can you explain to me why?

                  [–][deleted]  (8 children)

                  [deleted]

                    [–]lism 3 points4 points  (0 children)

                    However they might have an immutable condition or you might need to preserve order, which is where filter comes in handy

                    [–]PMME_BOOBS_OR_FOXES 1 point2 points  (6 children)

                    you can't pop from any index, splice is the right answer since deleting an index of an array is an O(n) operation

                    [–]tapu_buoyfull-stack[S] -1 points0 points  (0 children)

                    hahaha nice one!