How reliable are leetcode runtime stats?

VMware
mnjh l

Go to company page VMware

mnjh l
Oct 10, 2021 13 Comments

I ran the same program twice. First time it said I was faster than 5% of submissions and then second time the number became 63%. How do we get an accurate analysis?

72 PARTICIPANTS SELECT ONLY ONE ANSWER
VOTE VIEW RESULT

comments

Want to comment? LOG IN or SIGN UP
TOP 13 Comments
  • Coinbase
    תגמולבוטן

    Go to company page Coinbase

    תגמולבוטן
    Interviewers don't care about runtime, they care about asymptotic runtime.
    LC stats won't tell you asymptotic runtime, you gave to figure it out yourself and then compare to other solutions in the discussion section
    Oct 10, 2021 3
    • VMware
      mnjh l

      Go to company page VMware

      mnjh l
      OP
      Aah you mean big o
      Oct 10, 2021
    • Coinbase
      תגמולבוטן

      Go to company page Coinbase

      תגמולבוטן
      How your runtime relates to input size as input size grows larger and larger
      E.g. bubble sorting is O(n^2), merge sorting is O(n*log n)
      There are cases where a O(n^2) algorithm would run faster than a O(n*log n) algorithm on leetcode, because of a small enough input size in their test cases (happens very often)
      Interviewers generally don't care how fast your algorithm runs, they care about the asymptotic runtime.
      That being said, if your algorithm times out on leetcode, it probably has a terrible asymptotic runtime.
      Oct 10, 2021
  • Dell
    UDam06

    Go to company page Dell

    UDam06
    Very unreliable. Make this a poll
    Oct 10, 2021 2
  • SpaceX
    RocketEngg

    Go to company page SpaceX

    RocketEngg
    As reliable as rivian valuation numbees
    Oct 10, 2021 0
  • The backend hardware hosting their stuff gets faster over time as hardware get faster. So the same solution will end up being faster over time, even if nothing changes with the code
    Oct 10, 2021 0
  • Google / Eng
    makigero

    Go to company page Google Eng

    makigero
    I like to spend time optimizing to be 95%+ once I know my solution is asymptotically optimal. Since runtimes are very inconsistent, I usually run the solution multiple times.
    Oct 10, 2021 0