11

So I did an interview today and the problem was given a = 1 2 3 and b = 2 3 write code that finds the common elements.

I asked what the data structures are and they said it can be whatever so I said cool then we can use sets and do an interception to get unique elements.... this was in Python... but for the life of me I couldn't remember what the intercept notation was... and brought that up hoping they're give me a hint haha.

So I ended up writing a 8-9 line solution for what could've been a one liner fml: return a | b.

All because I didn't know the notation and still needed to give them something. Painful to write when I knew I was reinventing the wheel. Sign

I almost never use sets so this was heartbreaking hopefully I still get an offer!

How bad of a fail is this in y'all opinion?

Comments
  • 4
    Hmmmm. Try writing 15 lines for something that doesn't completely work, but the answer can be done in 1 line.

    Fml
  • 2
    @Stuxnet that helped (: and ouch. I've done it too. Isn't it a pain at the extra work done just from ignorance?
  • 2
    @dalastTomCruise Made me question if CS was a degree for me or not lol
  • 1
    @Stuxnet but you stuck with it right? I think everyone has had a moment like that at one time. Hopefully haha
  • 2
    @dalastTomCruise That happened last semester. In the intro to CS class.

    But so far still sticking with it. I'll see how it's going after 5 or 6 classes (the required for a minor in CS)
  • 0
    @2lazy2debug thanks man I was thinking that
  • 0
    Looking up docs for stuff like that is so normal that I'd be upset if they didn't allow it in an interview unless it was pseudo code.
Add Comment