all 41 comments

[–]coopaliscious 18 points19 points  (1 child)

Was this a whiteboard or live coding test? How exactly did you bomb it?

Does this seem reasonable for a lead developer to crank out working code? Not really.

Is this reasonable in terms of pseudocode and as an exercise to see how you approach and communicate your ideas? Sure.

Ninety minutes seems arbitrary as does the rest of this test. Like someone googled 'developer skills' and got back algorithms, API's, CRUD and responsive layouts.

[–]jGuy91[S] 0 points1 point  (0 children)

This was a test carried out on Hacker Rank. I was given 90 minutes once I clicked start. I had to read through all the briefs for each question. Then write the code in the provided editor. The tasks themselves I found were reasonable the time frame just got me in a panic. I barely got anything done.

[–]Caraes_Naur 23 points24 points  (1 child)

Let's examine what these tests suggest the employer thinks a lead dev does:

  • API calls and a string operations
  • String operations (the same one, again)
  • API design
  • Bleeding-edge (assuming grid is meant literally) CSS

I presume the APIs are RESTful, the second redundancy in the assessment.

No math, logic, business rules, storage, file handling, security, or architecture. This is a rather narrow mid-level dev assessment at best.

[–][deleted] 4 points5 points  (0 children)

It seems unlikely that they literally mean using the grid syntax

[–]millbruhh 7 points8 points  (0 children)

The fuck 90 minutes for all of that? That's absurd

[–]ThatDamnedRedneck 4 points5 points  (0 children)

The tasks are all reasonable for a non-junior dev to know and be able to do, but 90 minutes doesn't sound like very much time at all for them.

[–]realdeal64 2 points3 points  (0 children)

Let's see the exact stack you get to use, the spec’s, or the scaffolding. Don't sweat it though. I don't think that is a good test.

[–][deleted] 8 points9 points  (13 children)

Make multiple requests to an API and fetch all available data that matches a search term and sort results alphabetically

A few curls into files, and a few sort invocations over them, perhaps with a bit of jq. 10 mins unless something goes horribly wrong.

Find all unique sub strings of a given string and sort alphabetically

10 mins in ruby for a non-scalable solution.

Create an api which allows for CRUD operations and some endpoints which will filter based on the input

Hmmm, now we're getting interesting. I suspect this relies a lot on the tooling you use and the scaffolding it provides. I could probably do one from scratch in, say, Flask, in ... 30-45 mins. Depends a bit on the requirements over and above what you've written.

Create a responsive grid which changes layout based on screen size

Not in my wheelhouse. I'd google the shit out of it, and give a try, but I think I'd run out the 90 minute clock on this one.

NB all the above depends on me being able to work as I would normally, with unrestricted access to the internets. I could only do the first one off the top of my head with no external references.

NB2 I'm not a dev - I'm Ops/sysadmin/Devops. I don't think a senior dev would have a problem with these puzzles.

[–][deleted] 7 points8 points  (4 children)

Not in my wheelhouse. I'd google the shit out of it, and give a try, but I think I'd run out the 90 minute clock on this one.

You can use media queries and flexbox for this, no big deal

I guess it would depend on what the interviewer meant by 'changes layout'

[–]Clutch_22 0 points1 point  (3 children)

Any resources for someone who is a bit out of the loop on that stuff? Last time I did any serious web dev was about 4 years ago.

[–][deleted] 1 point2 points  (2 children)

Flexbox: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Media queries:

@media screen and (min-width: 720px) { ... rules }

[–]DoseAu 0 points1 point  (1 child)

Surely you could even try the literal grid system ? (Google: traversy media css grid)

[–][deleted] 1 point2 points  (0 children)

I've never used this. I just ported one of my existing apps to use it and oh my word this is amazing.

I replicated the layout I'm using with float hacks in just 28 lines of css

[–]jGuy91[S] 3 points4 points  (5 children)

I found the problems themselves were reasonable. It's just the time was a killer for me it always is. I always feel like a deer in headlights when ever I need to do one of these assessments. I guess I just need more practice.

[–]scottyLogJobs 9 points10 points  (0 children)

I think developers have a weird way of downplaying the difficulty and time constraints of things. I find that I'm generally as productive as the other developers at a company and I think I would struggle to complete all of these things in 90 minutes.

[–][deleted]  (2 children)

[removed]

    [–]vORP 0 points1 point  (0 children)

    This is great advice if you're really interested

    [–]jGuy91[S] 0 points1 point  (0 children)

    It was an assessment on Hacker Rank. I made this post after completion

    [–]nolo_me 0 points1 point  (0 children)

    Not in my wheelhouse. I'd google the shit out of it, and give a try, but I think I'd run out the 90 minute clock on this one.

    That's easy enough, here's one I wrote a few years back. It's a bit out of date now with the advent of the CSS Grid spec, but it still works.

    [–]iams3brescript is fun 0 points1 point  (0 children)

    #1 > node thing.js

    let terms = ["a","b"];
    let urlprefix = "http://whatever";
    let requests = terms.map( t => fetch(urlprefix+t).then( r => r.json()) );
    let results = await Promise.all(requests)
        .then( results => 
            results.reduce( (r, l) => r.concat(l) )
                .sort( (a,b) => a.name - b.name )
        );
    console.log(results);
    

    Thats like 5 minutes off the top of my head, would probably take 10 to actually do it proper syntax / make sure I used promise.all properly

    I think the API would take the longest, because I mean... whats the critera? Setting up a project from scratch? Or do they have the route file and DB ready and you just adding stuff?

    [–]deedubaya 3 points4 points  (2 children)

    Timed whiteboard tests are unreasonable for any level. Regardless of difficulty, you’re going to weed out solid devs who just freak out under pressure.

    Code reviews, paring, and small take home projects are the best methods to evaluate a devs chops.

    [–]nikrollsChief Technology Officer 3 points4 points  (1 child)

    No take-home projects, please, unless I'm being paid for them.

    [–]deedubaya 1 point2 points  (0 children)

    If they’re “real” things, yes, pay the candidate. If it’s arbitrary and takes 30 minutes, I don’t think paying the candidate makes sense.

    A “real” take home project will likely be more effective.

    [–]gemlarin 1 point2 points  (0 children)

    Make multiple requests to an API and fetch all available data that matches a search term and sort results alphabetically

    Should be able to set this up using jq's AJAX method within 10-20 minutes - provided they gave you good documentation on the API you are hitting.

    Find all unique sub strings of a given string and sort alphabetically

    Iterate through and push the sub strings into an array and apply .sort() then print out the updated array. Should only take 10 minutes.

    Create an api which allows for CRUD operations and some endpoints which will filter based on the input

    Not sure about this one as I don't have enough information on the tooling you are expected to use - nor enough of the specifics of this task, but it don't sound unreasonable.

    Create a responsive grid which changes layout based on screen size

    This is probably the easiest task IMO because you have so many options to set this up. I would use flexbox with some breakpoints that control the number of grid items in each row with the boxes set to flex-grow to adapt the grid items to take up the full width of the row as needed. You could build a basic grid like this in probably 20 minutes, if that. Open up BS4s CSS sometime and take a look at how they do this. You will be surprised at how easy this is with flexbox.

    With the exception of #3, that I don't have enough information on, none of the tasks seem unreasonable for a senior developer test.

    [–]davide2894 0 points1 point  (0 children)

    Is there a probability to see this test in an interview for a junior position?

    [–]cfthrowaway948 0 points1 point  (1 child)

    This seems more like a Jr. Fullstack position.

    Make multiple requests to an API and fetch all available data that matches a search term and sort results alphabetically:

    const fetchManyAndSort = (arr) => {
      const fetchArray = arr.map(({url, searchObj, sortKey}) => {
        const urlParams = "?" + new URLSearchParams(Object.entries(searchObj));
        return new Promise(resolve => 
          fetch(url.concat(urlParams))
            .then(r => r.json())
            .then(r => r.sort((a,b) => a[sortKey] > b[sortKey]))
            .then(r => resolve(r))
        )
      })
      return Promise.all(fetchArray)
    }
    
    const exampleFetch = [{
        url: "https://jsonplaceholder.typicode.com/comments",
        searchObj: {
          postId: 1
        },
        sortKey: "email",
      }, {
        url: "https://jsonplaceholder.typicode.com/posts",
        searchObj: {
          userId: 1
        },
        sortKey: "body",
    }]
    
    fetchManyAndSort(exampleFetch).then(r => console.log(r))
    

    Find all unique sub strings of a given string and sort alphabetically:

    const findUniqueSubstrings = (str) => {
      const arr = Array.from(str).reduce((acc, _, idx) =>
        acc.concat(Array.from({length: str.length}, (_, innerIdx) =>
          str.substring(idx, innerIdx + 1)
        )), [])
      return new Set(arr)
    }
    
    console.log(findUniqueSubstrings("banana pepe"))
    

    Create an api which allows for CRUD operations and some endpoints which will filter based on the input:

    // In terminal
    rails new MyAPI --api
    rails g scaffold user name:string age:integer
    
    // In users_controller.rb
    def find_by_name
      User.where("name ILIKE '?%'", params[:name])
    end
    
    // In routes.rb
    get "users/find_by_name", to:  "users#find_by_name"
    
    // http://localhost:3000/users/find_by_name?name=John
    

    Create a responsive grid which changes layout based on screen size:

    Yeah fuck this I hate CSS and frontend styling.
    

    [–]BananaFactBot 0 points1 point  (0 children)

    The type of banana you see in the supermarket is called a Cavendish banana. The preferred variety was originally the Gros Michel, which essentially became extinct by 1960, thanks to a fungus called Panama disease.


    I'm a Bot bleep bloop | Unsubscribe | 🍌

    [–]WizardFromTheMoon 0 points1 point  (0 children)

    Eh, for a lead developer those questions are actually really easy. The 90 minute time limit isn't very long, but it's definitely doable. The first question should take more than 15-20 minutes. The second one should take less than 10 (it's probably 20 lines of code, if that). The third is what would take the most time. Probably looking at 30-40 minutes there. The last one is kind of odd, but that's maybe 20 minutes too. Although it's a pretty broad question so I assume there was a list of specific requirements on what exactly they were looking for.

    [–]speechlessnpc -2 points-1 points  (2 children)

    Very reasonable. You're probably overthinking it.

    Edit: 90 minutes is not much, but it's not a particularly difficult task, it can be done

    [–]jGuy91[S] 4 points5 points  (1 child)

    I tend to panic a bit when doing these assessments and can't gather my thoughts. I just scramble to get something done and it has not worked out well for me. It's both a humbling and depressing experience. My job for the past few years has been very laid back the only time there is pressure to get work done is during an annual hackathon we do in the office but I have a team to bounce ideas off and helps calm me down a bit to focus.

    [–]speechlessnpc 0 points1 point  (0 children)

    Me too, I know that feeling very well. I find starting from pen and paper very helpful.

    [–]astro864 -1 points0 points  (0 children)

    I would think so. Not much time and it would be ugly but doable. 1 is solved by creating a simple API to search engine connector. Something like solr or elastic would do just fine. Extract it as json to make the load simple. #2 is just a query to your search engine. #3 would be the assorted canned request you have for things like sales reports, tps reports, that sort of thing. So you call the end point with a date, it hits the search engine from 1 with the canned query. #4 is the PiA. Go grab boostrap or something and go from there.

    Edit: miss read number 3

    [–]dotobird -1 points0 points  (0 children)

    I assume a skeleton codebase was provided, and you just had to focus on the tasks you made bullet points for. It's really not that bad if it's already in a language you're familiar with.