Hard SQL questions

Walmart.com sqlbot
Aug 3, 2018 17 Comments

I have solved all Leetcode SQL questions. Need to practice some hard ones for my DS interview at FB. Any pointers or examples? My phone interview feedback was "weak in programming" but they gave me second round because of good product thinking and because I used a pseudo code to give enough hints that I can solve the problems. TC 350 yoe 10

comments

Want to comment? LOG IN or SIGN UP
TOP 17 Comments
  • New / Mgmt
    DodgingBS

    NewMgmt

    PRE
    Bridgewater Associates
    BIO
    Systems Architect
    DodgingBSmore
    Wrong the answer is 12k per os license
    Aug 3, 20180
  • Google
    QHON68

    Google

    PRE
    Microsoft
    QHON68more
    I wouldn't want to work for any company that asked SQL questions in an interview.. seems insulting
    Aug 3, 20182
    • Walmart.com sqlbot
      OP
      The world is full of all kinds of people with different skills. Not everyone is good at everything. One way to respect everyone with different abilities is to respect all jobs, big and small. It may not be for you, but there is always someone for whom it's a dream job. ☮️
      Aug 3, 2018
    • Intuit whocates
      I’ll be my money Google fails a SQL interview then gets insulted that all his knowledge didn’t help.
      Jan 8
  • New / Mgmt
    DodgingBS

    NewMgmt

    PRE
    Bridgewater Associates
    BIO
    Systems Architect
    DodgingBSmore
    Whats the difference between mysql and sql
    Aug 3, 20182
    • MedeAnalytics tcgtfo
      Spelling
      Aug 3, 2018
    • Edmunds.com 0xd09e
      MySQL is a dialect of SQL. It has different functions and features to, for example, PostgreSQL
      Aug 3, 2018
  • Walmart.com sqlbot
    OP
    Btw by hard problems I meant problems that are good to test your query skills, not whether you can be a DBA
    Aug 3, 20185
    • Accenture XxSWExX
      SELECT * FROM facebook_db WHERE dataAltersThePresidentialElection

      Write this query to get hired instantly.
      Aug 3, 2018
    • Walmart.com sqlbot
      OP
      Hmm. That's not efficient. It can be shortened to select * from FacebookDB where country in ( USA)
      Aug 3, 2018
    • Twilio / EngTechBrunch
      Please don’t confuse efficiency with length in your interview 😃
      Aug 4, 2018
    • Walmart.com sqlbot
      OP
      Twilio, any non intuitive counter example?
      Aug 4, 2018
    • Twilio / EngTechBrunch
      I’ll try! consider a join vs a nested query.. even if the join is longer in length it’s likely more efficient to execute. I just meant number of characters does not correlate to execution efficiency
      Aug 4, 2018
  • LinkedIn tVfy86
    So “weak in programming” for DS at facebook is just referring to sql? Not even R or python?
    Aug 4, 20181
    • Walmart.com sqlbot
      OP
      Yeah you won't be doing much modelling. Just observing data and analysing results of experiments
      Aug 4, 2018
  • Walmart.com sqlbot
    OP
    Really hard one that they won't ask. Return nth Fibonacci number. Can it be done without using variables?
    Aug 4, 20180
  • Walmart.com sqlbot
    OP
    You can't spell mysql without sql
    Aug 3, 20180

Join verified employees in our anonymous social network!Download the app!

close