Onsite interview expectations

Salesforce CmbP63
Aug 15, 2018 8 Comments

I have onsite interviews from Facebook, LinkedIn, Uber, Airbnb etc in 3 weeks time. I had some questions on expectations on coding interviews. I have done good number of Leetcode questions, but what I observed is that I always get the happy cases working within first 2-3 tries. But when I submit, there will be edge cases that fail. I take another 4-5 attempts to fix those cases.
My question is, how would you approach a question in a real interview? Write down happy test cases, edge cases, extreme cases, obvious cases (like null, array.length==0) and then write the code?
Would the interviewer expect a code, that when submitted to leetcode, just gets accepted? If not, what is a good line between accept and reject?
PS: In the phone screens, I just handled happy cases and obvious cases and cleared the phone screens.


Want to comment? LOG IN or SIGN UP
TOP 8 Comments
  • Intel hello73
    OP, how many months of prep did you take to crack all the phone screens ? How many Leetcode problems?
    Aug 16, 2018 0
  • Salesforce / Eng

    Salesforce Eng

    Never submit your code in leetcode right after you write it; this definitely is not how you would do it in actual interviews is it??
    Make sure to go over your code carefully, catch compile errors and logical errors by validating everything manually. Never depend on automatic tests and compilers in your practice tests.
    Aug 16, 2018 0
  • CA Technologies / Eng Amzaon
    I had exactly same issue. I think this can be improved by solving more Leetcode problems. I started to paying attention possible scenarios while Im drilling down. It takes some time but when you get the sense of determining the possible scenarios, you will get an idea pretty quickly
    Aug 15, 2018 0
  • Apple &02bgp
    Apr 4 0
  • Amazon / Eng S.Nadella
    You should aim to get all the happy cases and edge cases on the first try. In a real interview there is no submit button telling you exactly what you got wrong.
    Aug 16, 2018 0
  • Facebook 77⅞
    You're expected to be able to walk through some examples and find bugs yourself without a system telling you.

    Fucking kudos for considering test cases though. If I had a quarter for every interviewee who ignored my repeated "and we'll write unit tests afterwards, so make sure you have a strategy for that", I'd have... about three fiddy

    PS: if there's boilerplate like input validation, feel free to ask the interviewer if they want production quality or if you can leave it as a todo after explaining what you'd check for and how you'd handle it
    Aug 15, 2018 0
  • GE


    Life can be simple or complex!
    Having failed google onsite after not doing horrible I feel you need to do with the most best beautiful code to excel. Bar is high
    Aug 15, 2018 0
  • Qualcomm / Eng

    Qualcomm Eng

    Aug 15, 2018 0


    Real time salary information from verified employees