Facebook Data Engineer Interview Questions | Glassdoor.co.uk

Facebook Data Engineer Interview Questions

Interviews at Facebook

129 Interview Reviews

Experience

Experience
67%
17%
16%

Getting an Interview

Getting an Interview
48%
24%
19%
5
3
1

Difficulty

3.2
Average

Difficulty

Hard
Average
Easy

Helpful (48)  

Data Engineer Interview

Anonymous Interview Candidate
No Offer
Positive Experience
Average Interview

Application

I applied through other source. I interviewed at Facebook.

Interview

Telephonic Interview: 30 mins SQL and 30 mins coding.
Expectation: 4/5 in SQL should be correct and 3/5 in coding should be correct.

Most of the folks have already explained this process in detail so will jump on the interview questions.

Interview Questions

  • want you to write me a simple spell checking engine.

    The query language is a very simple regular expression-like language, with one special character: . (the dot character), which means EXACTLY ONE character (it can be any character). So, for example, 'c.t' would match 'cat' as the dot matches any character. There may be any number of dot characters in the query (or none).

    Your spell checker will have to be optimized for speed, so you will have to write it in the required way. There would be a one-time setUp() function that does any pre-processing you require, and then there will be an isMatch() function that should run as fast as possible, utilizing that pre-processing.

    There are some examples below, feel free to ask for clarification.

    Word List:

    [cat, bat, rat, drat, dart, drab]

    Queries:

    cat -> true
    c.t -> true
    .at -> true
    ..t -> true
    d..t -> true
    dr.. -> true
    ... -> true
    .... -> true

    ..... -> false
    h.t -> false
    c. -> false
    */

    // write a function
    // Struct setup(List<String> list_of_words)
    // Do whatever processing you want here
    // with reasonable efficiency.
    // Return whatever data structures you want.
    // This function will only run once

    // write a function
    // bool isMatch(Struct struct, String query)
    // Returns whether the query is a match in the
    // dictionary (True/False)
    // Should be optimized for speed   16 Answers
  • Given an array of integers, we would like to determine whether the array is monotonic (non-decreasing/non-increasing) or not.
    Examples:
    // 1 2 5 5 8
    // true
    // 9 4 4 2 2
    // true
    // 1 4 6 3
    // false

    //1 1 1 1 1 1
    // true   17 Answers
  • Calculate the average word length.
    For the given set of words return the average word length.   7 Answers
  • products sales
    +------------------+---------+ +------------------+---------+
    | product_id | int |------->| product_id | int |
    | product_class_id | int | +---->| store_id | int |
    | brand_name | varchar | | +->| customer_id | int |
    | product_name | varchar | | | | promotion_id | int |
    | price | int | | | | store_sales | decimal |
    +------------------+---------+ | | | store_cost | decimal |
                                    | | | units_sold | decimal |
                                    | | | transaction_date | date |
                                    | | +------------------+---------+
                                    | |
    stores | | customers
    +-------------------+---------+ | | +---------------------+---------+
    | store_id | int |-+ +--| customer_id | int |
    | type | varchar | | first_name | varchar |
    | name | varchar | | last_name | varchar |
    | state | varchar | | state | varchar |
    | first_opened_date | datetime| | birthdate | date |
    | last_remodel_date | datetime| | education | varchar |
    | area_sqft | int | | gender | varchar |
    +-------------------+---------+ | date_account_opened | date |
                                          +---------------------+---------+

    Question 1:
    What brands have an average price above $3 and contain at least 2 different products?

    Question 2:
      To improve sales, the marketing department runs various types of promotions.
      The marketing manager would like to analyze the effectiveness of these promotion campaigns.
      In particular, what percent of our sales transactions had a valid promotion applied?

    Question 3:
      We want to run a new promotion for our most successful category of products
      (we call these categories “product classes”).
      Can you find out what are the top 3 selling product classes by total sales?

    Question 4:
        We are considering running a promo across brands. We want to target
        customers who have bought products from two specific brands.
        Can you find out which customers have bought products from both the
        “Fort West" and the "Golden" brands?   12 Answers

Other Interview Reviews for Facebook

  1.  

    Data Engineer Interview

    Anonymous Interview Candidate
    No Offer
    Positive Experience
    Average Interview

    Application

    I applied online. I interviewed at Facebook.

    Interview

    great,it was 60 min coding interview using codera ,30 min sql and 30 min python. each section has three to five question needed to be answered, both parts are very fundemental

    Interview Questions


  2. Helpful (5)  

    Data Engineer Interview

    Anonymous Interview Candidate
    No Offer
    Positive Experience
    Average Interview

    Application

    I applied through an employee referral. The process took 4+ weeks. I interviewed at Facebook in August 2020.

    Interview

    Data Engineer Phone Interview, Firstly recruiter ask 5 basic python, 5 sql then 1 hour phone interview 24 minute Pyhton, 25 minute sql, look easy python and SQl mostly Glassdooor

    Interview Questions

    • Python 1

      #1.returns the number of times a given character occurs in the given string
      s1='missisipi'
      #print(s1.find('s'))
      res=[]

      for i in range(len(s1)):
          #print(s1[i])
          if s1[i]=='s':
              res.append('s')
      print(len(res))
      #2.[1,None,1,2,None} --> [1,1,1,2,2]
      arr=[None,1,2,None]
      new_l=[]
      for i in range(0,len(arr)):

          if arr[i] != None:
              new_l.append(arr[i])
          else:
              new_l.append(arr[i-1])

      print(new_l)

      #2. (python) Given two sentences, construct an array that has the words that appear in one sentence and not the other.
      A = "Geeks for Geeks"
      B = "Learning from Geeks for Geeks"
      d={}
      for w in A.split():
          if w in d:
              d[w]=d.get(w,0)+1
          else:
              d[w]=1
      for w in B.split():
          if w in d:
              d[w]=d.get(w,0)+1
          else:
              d[w]=1
      unmatchedW=[w for w in d if d[w]==1]
      print (unmatchedW)

      3.

      d = {"a": 4, "c": 3, "b": 12}
      [(k, v) for k, v in sorted(d.items(), key=lambda x: x[1], reverse=True)]
      #[('b', 12), ('a', 4), ('c', 3)]

      SQL

      # # sales # products
      # +------------------+---------+ +---------------------+---------+
      # | product_id | INTEGER |>--------| product_id | INTEGER |
      # | store_id | INTEGER | +---<| product_class_id | INTEGER |
      # | customer_id | INTEGER | | | brand_name | VARCHAR |
      # +---<| promotion_id | INTEGER | | | product_name | VARCHAR |
      # | | store_sales | DECIMAL | | | is_low_fat_flg | TINYINT |
      # | | store_cost | DECIMAL | | | is_recyclable_flg |… Show More

      1.
        find top 5 sales products having promotions

      Select Sum(s.store_sales), brand_name, count(p.product_id)
      from products p inner join
      sales s p.product_id = s.product_id
      where promotion_id is not null
      group by brand_name
      having count(p.product_id) =1 /* single-channel media type */
      order by 1 desc
      limit 5

      2.
      # -- % Of sales that had a valid promotion, the VP of marketing
      # -- wants to know what % of transactions occur on either
      # -- the very first day or the very last day of a promotion campaign.
      select sum(case when valid_promotion = 1 then 1 else 0 end)/count(*) * 100 as percentage
      from sales
      where day = First_day(date) or day = last_day(date)

      or

      select
      sum(case when transaction_date = (select min(transaction_date) from sales) then 1 else 0)/count(*) as first_day_sales,
      sum(case when transaction_date = (select max(transaction_date) from sales) then 1 else 0)/count(*) as last_day_sales
      from sales

      or

      select
      avg(transaction_date in (p.start_date,p.end_date))*100 as first_last_pct
      from
      sales s
      join promotions p using(promotion_id)   3 Answers
  3. Helpful (6)  

    Data Engineer Interview

    Anonymous Interview Candidate in Menlo Park, CA (US)
    No Offer
    Negative Experience
    Average Interview

    Application

    I applied through a recruiter. I interviewed at Facebook (Menlo Park, CA (US)) in July 2020.

    Interview

    Recruiter(reached me over linkedin) called me to understand my work experience and how comfortable I am with SQL and Python.Asked some 5 sql and 5 python question to qualify for next round.Then He forgot to schedule my telephone interview for 3 days. I had to chase him over linkedin. finally it got scheduled after 3 weeks of time. I was able to solve 4 SQL /3 coding will all cases passed. It is been more than a week , the recruiter is no longer responding and I have no idea what happened .(I am assuming I am rejected but no formal email). I am really surprised with Facebook interview structure or may be I was out of luck.

    Interview Questions

    • SQL : questions are already on glassdoor can be solved using AVG, COUNT , LEFT JOIN , MULTI table join. Mostly focus on %age type questions   Answer Question
    • Python : fill in the blank(edge case of input list : None , []) ,find count of letter in a string , uncommon words between 2 strings.   10 Answers

  4.  

    Data Engineer Interview

    Anonymous Interview Candidate
    No Offer
    Positive Experience
    Easy Interview

    Application

    I applied through a recruiter. I interviewed at Facebook in July 2020.

    Interview

    The interview process was very easy. recruiter call, phone interview and virtual on-site.
    I didn't get the result yet for my phone interview, but i wish i had some more time. Please prepare very well with all the glassdoor questions that you see.!!! when you are 2 days away for your interview, just make sure you answer all the glassdoor questions for practice, can help you a lot for boosting confidence.

    Interview Questions

    • Can't give the questions in detail, but every question in glassdoor in the last 6 months will definitely help.!   2 Answers

  5. Helpful (7)  

    Data Engineer Interview

    Anonymous Interview Candidate
    No Offer
    Positive Experience
    Average Interview

    Application

    I applied online. The process took 3 weeks. I interviewed at Facebook in June 2020.

    Interview

    Found a FB recruiter on linkedin and send her a connection request. Next day got a reply back asking for contact details and if I am interested in positions in Data Engineer.
    3 days later got a call with another recruiter who asked 5 sql and 5 python questions. Sql question on left join, having clause etc and python on linked list, stack (what data structure is FIFO) true/false type questions.
    Post that was given 14 days to prepare for telephonic interview - same as 30 mins SQL and 30 mins python.
    Telephonic interview was nice but again its matter of how comfortable and fast you are. I was able to answer 3 out of 3 sql and 2 out of 3 python. Was short of time so interviewer gladly asked to close the call.
    I think I can do better in direct interviews where they ask design questions but these coding interviews with timer make me nervous. Please focus on that part and you can easily be able to go past this round. Most of the questions are same as in glassdoor.

    Interview Questions

    • SQL questions on promotions, sales schema.
      what %age of products have both non fat and trans fat.
      find top 5 sales products having promotions
      what %age of sales happened on first and last day of the promotion

      Mysql was used and interviewer asked to if this can be done without subquery.
      Python:-
      [1,None,1,2,None} --> [1,1,1,2,2]
      Ensure you take care of case input[None] which means None object.

      find s in missisipi.   7 Answers

  6. Helpful (3)  

    Data Engineer Interview

    Anonymous Interview Candidate
    No Offer
    Neutral Experience
    Easy Interview

    Interview

    Phone interview first round for Senior Data Engineer. They asked 3 SQL and 3 Python coding questions and i coded all of them and all test cases passed. Not sure why they didnt comeback for next round. may be they expected for total of 10 questions

    Interview Questions

    • Find common words in 2 sentences   4 Answers

  7.  

    Data Engineer Interview

    Anonymous Interview Candidate in Menlo Park, CA (US)
    Declined Offer
    Neutral Experience
    Average Interview

    Application

    The process took 3 weeks. I interviewed at Facebook (Menlo Park, CA (US)).

    Interview

    Had the technical phone screen. The questions are trivial, but under time pressure and interview stress, they can become challenging, beware. The interviewer was really nice, but had an accent and did a bad job at explaining the problems beyond what was on the screen, which added to the confusion. Overall a neutral experience. Like many others have noted, the questions themselves are NOT difficult, but under the circumstances, they could get confusing.

    Interview Questions

  8. Helpful (22)  

    Data Engineer Interview

    Anonymous Interview Candidate in Menlo Park, CA (US)
    No Offer
    Positive Experience
    Average Interview

    Application

    I applied online. The process took 2 weeks. I interviewed at Facebook (Menlo Park, CA (US)) in April 2020.

    Interview

    It was a great process. Applied through a recruiter who contacted me on Linkedin then we set up a call to chat about my experience and the interview process. We scheduled a technical round and I was able to answer 3 SQL and 2.5 python . Looks like need at least 4 and 4 to get to next round so my journey ended here.

    Interview Questions

    • # # sales # products
      # +------------------+---------+ +---------------------+---------+
      # | product_id | INTEGER |>--------| product_id | INTEGER |
      # | store_id | INTEGER | +---<| product_class_id | INTEGER |
      # | customer_id | INTEGER | | | brand_name | VARCHAR |
      # +---<| promotion_id | INTEGER | | | product_name | VARCHAR |
      # | | store_sales | DECIMAL | | | is_low_fat_flg | TINYINT |
      # | | store_cost | DECIMAL | | | is_recyclable_flg | TINYINT |
      # | | units_sold | DECIMAL | | | gross_weight | DECIMAL |
      # | | transaction_date | DATE | | | net_weight | DECIMAL |
      # | +------------------+---------+ | +---------------------+---------+
      # | |
      # | # promotions | # product_classes
      # | +------------------+---------+ | +---------------------+---------+
      # +----| promotion_id | INTEGER | +----| product_class_id | INTEGER |
      # | promotion_name | VARCHAR | | product_subcategory | VARCHAR |
      # | media_type | VARCHAR | | product_category | VARCHAR |
      # | cost | DECIMAL | | product_department | VARCHAR |
      # | start_date | DATE | | product_family | VARCHAR |
      # | end_date | DATE | +---------------------+---------+
      # +------------------+---------+
      # */

      # Question 1:
      # -- What percent of all products in the grocery chain's catalog
      # -- are both low fat and recyclable?
      #   3 Answers
    • Question 2:
       What are the top five (ranked in decreasing order)
       single-channel media types that correspond to the most money
      the grocery chain had spent on its promotional campaigns?   1 Answer
    • # Question 3:
      # -- % Of sales that had a valid promotion, the VP of marketing
      # -- wants to know what % of transactions occur on either
      # -- the very first day or the very last day of a promotion campaign.   7 Answers
    • Question 1:
      # Complete a function that returns the number of times a given character occurs in the given string

      # For example:
      # - input string = "mississippi"
      # - char = "s"
      #
      # - output : 4
      """   6 Answers
    • """
      # Question 2:
      # Fill in the blanks
      #
      # Given an array containing None values fill in the None values
      # with most recent non None value in the array

      #
      # For example:
      # - input array: [1,None,2,3,None,None,5,None]
      #
      # - output array: [1,1,2,3,3,3,5,5]
      #   8 Answers
    • # Question 3:
      # Complete a function that returns a list containing all the mismatched words (case sensitive) between two given input strings

      # For example:
      # - string 1 : "Firstly this is the first string"
      # - string 2 : "Next is the second string"
      #
      # - output : ['Firstly', 'this', 'first', 'Next', 'second']   5 Answers

  9. Helpful (6)  

    Data Engineer Interview

    Anonymous Interview Candidate
    No Offer
    Positive Experience
    Average Interview

    Application

    I applied online. I interviewed at Facebook.

    Interview

    technical screening is 1hour SQL+Python.They are pretty basic but due to time crunch. I could solve 4 questions in sql, 5th question partially and 3 questions in python 4th one partially.
    I've onsite scheduled ,looking for kind of questions that we can expect in data modeling,product sense and python coding in onsite. Please suggest.

    Interview Questions

    • basic questions in python using loops   5 Answers

Don't Miss Out On a Job You Love
Upload a CV to easily apply to jobs from anywhere. It's simple to set up.