SQL Interviews

New
G_mane_FB

New

G_mane_FB
Feb 29, 2020 13 Comments

Often, multiple type of sql solutions exist for a problem. For example whether to use window functions or joins or cte, Any of these would give correct answer, but limitations would be sql versions or readability.

How would you chose which solution is appropriate?

comments

Want to comment? LOG IN or SIGN UP
TOP 13 Comments
  • For an interviewer doesn't really matter. Depending on the case e.g. Join vs Subquery vs CTR you can always check which of these is using the lowest resources and as such processing is faster if that is of importance.
    Mar 1, 2020 1
    • New
      G_mane_FB

      New

      G_mane_FB
      OP
      Right. But, it is obvious that window functions are readable and easier when they can be used, I am not sure if interviewer will be happier with using those or without.
      Mar 1, 2020
  • Amazon / Eng
    fahrenheit

    Go to company page Amazon Eng

    PRE
    Zalando
    fahrenheit
    As you write up a solution, let your interviewer know that you could also use other techniques to solve it, and what the tradeoffs could be in terms of available indexes and the distribution of data. A good interviewer cares less about the specific solutions you come up with and more about your thought process and how comprehensive your understanding is.
    Mar 1, 2020 0
  • Are these sql questions asked in a swe interview? I've never had one before
    Mar 1, 2020 1
    • New
      G_mane_FB

      New

      G_mane_FB
      OP
      Not in swe, usually for analytics roles
      Mar 1, 2020
  • Google
    Ben Dover.

    Go to company page Google

    Ben Dover.
    I choose whatever comes to my mind first. It also depends on the tables.
    Mar 1, 2020 0
  • Amazon
    BlindIy

    Go to company page Amazon

    BlindIy
    My latest sql interview was only hackerrank questions about substr... I was super disappointed as it didn’t really test sql. There wasn’t a single join even.
    Mar 1, 2020 4