27

- Get invited to apply to job
- Technical interview, guy shows up late starts small talk wasting time and gives me the exercise
- Start implementing the first algorithm, finish it passing min test cases then realize there's a solution that would make both algorithms a breeze
- I pitch my solution realizing there's no much time left, cuz we lost almost 20 min of my test hour talking about BS plus the almost 10 min he arrived late, and reassure the interviewer it can be developed faster
- Interviewer says it doesn't matter, we should finish edge cases
- Kay no problem, finish the first algorithm successfully and explain pitfalls on the second part with the current implementation
- I tell him there's a better solution but he doesn't seem to care, he says time's up

Now here's the funny part.

I get called by the recruiter today (2 weeks later) and she says "They are happy with your soft skills but feel there are some gaps with your coding, they would like to repeat the technical interview because they didn't feel there was much time to assess the 'gaps' ".
Interviewers, either I'm competent enough to work for you or not, your tests must be designed to assess that, if you see you can't fit the problem you want in the time you have left change the problem, reschedule or here's an idea...LEAVE THE BS CHITCHAT TILL THE END AND START THE INTERVIEW ON TIME. When I do interviews I always try to have one complete free hour and a one algorithm exercise because I expect the candidate to solve it, analyze it and offer alternatives or explain it, I've never had someone finishing more than 2 an hour.

You can keep your job I'll keep my time. I'll write a similar problem on the comments to pass on the knowledge for people who enjoy solving these kinds of problems, can't give you the exact same thing, also tip guys don't do NDA's for interviewing it makes no fucking sense trust me no one cares about your fizz buzz intellectual property.

Comments
  • 2
    Assume you have a CustomList class, the list class has an array in it, it has one function fizz(n) that returns the first n elements in the array, it remembers the last index so it has the following outputs for the following inputs: CustomList(['a', 'b', 'c'])

    cl.fizz(2) -> ['a', 'b']

    cl.fizz(3) -> ['c']

    cl.fizz(1) -> null

    Now implement a SuperCustomLists class that you can add custom lists to, it should be able to remember the current list it's using, it should have a fizz(n) function and a del(CustomList cs) function. It should behave the following way assuming an instance contains the following custom lists ['a', 'b', 'c'], ['d', 'e']

    scl.fizz(4) -> ['a', 'b', 'c', 'd']

    scl.fizz(2) -> ['e']

    scl.fizz(1) -> null
  • 1
    Constraints

    Objective: Make fizz O(n) and del O(1) preferably (my best solution has this O's if you can do it better then disregard), you can't peek inside the arrays, you can't change the input params for the functions (i.e del must accept an instance of custom list), if you remove the current list for the next fizz start at the next one. Start by developing fizz.
  • 2
    For the del, I would maintain a map of hashes and keep updating it as and when fizz is invoked on the main super list
  • 1
    @asgs it’s a way but you would need to keep the map and the list sync’d and might get cumbersome
  • 2
    So you actually signed an NDA for that interview?!
  • 5
    @Oktokolo yeah, should’ve taken that as a red flag
  • 2
    @JKyll I am not sure about the cumbersomeness. Removing/accessing the hash entry of this list from the map is O(1). To avoid the left shift of the array elements in the list, the list itself could be marked as -1 for future skipping. It would make fizz O(n+k), k being lists deleted

    How did you implement this?
  • 2
    @asgs you can store the reference of your current list that way you can ignore depleted lists, I don’t want to spoil it but the way I did it with a scripting language was using a map and references. Think about a linked list. At least that was my best attempt wasn’t allowed to do it at the interview 🤷‍♂️
  • 2
    @JKyll looks close :-)
  • 1
    @asgs yeah your solution might be the same or similar. 🤙
  • 1
    @JKyll Ken. The list *class* has an array in it? So is this a static array, or am I misunderstanding and this is an instance variable?
  • 2
    @Wisecrack yeah it’s an instance variable, it’s set on the constructor function and passed as an argument. The point is you can only interact with the class through the fizz function
  • 2
    The picture shows all of me. When I went in for a quick fix of a few lines of code. I ended up breaking the whole program.
Add Comment