coding problems you have seen/asked in interviews.

West Corporation theocean
Jul 31, 2018 29 Comments

Post coding/system design problems you have seen as interviewee or asked as an interviewer in onsite/phone screen/online test and what you expect from candidates.
(I know most of the things are there on leetcode but still)

If you have signed non disclosure then share problem but don't bother mentioning company name or write xyz company. I guess it won't break the NDA.

Faang, Microsoft, Uber, Lyft, Airbnb, LinkedIn, PayPal, salesforce, Yahoo, Zillow, Walmart, expedia, start ups and similar

Let's start...

comments

Want to comment? LOG IN or SIGN UP
TOP 29 Comments
  • Microsoft rvmaestro
    There’s literally a site for this
    Jul 31, 2018 2
    • Amazon / Eng Idiot|Moro
      Starts with a L.... don't remember the rest.
      Jul 31, 2018
    • Juniper drfxz1uyg
      Localhost:8080 ??
      Aug 1, 2018
  • Google ∞ + 1
    Google: lunch hour (eating). I think I solved it optimally.
    Jul 31, 2018 7
    • Tesla LEETCODER
      You need to find the shortest path to your fav food right? I guess then you have to solve how you eat your fav food optimally. Sounds like a two part question 🤔
      Jul 31, 2018
    • Given a tray of size nxm, given an n list of food items on differing size containers and costs. How can you maximize the cost of food you select?
      Jul 31, 2018
    • Follow up question. Food items are distributed across room and there is travel item to consider now. Maximize the cost of food selected given time t.
      Jul 31, 2018
    • Microsoft / Eng glass666
      it’s a distributed multi reader/ writer problem with necessary considerations for load balancing as well as frontend design ( how your food looks like).
      Jul 31, 2018
    • Tesla LEETCODER
      Shit now I understand how google comes up with these interview questions.
      Jul 31, 2018
  • West Corporation theocean
    OP
    Msft - add 2 numbers Linkedlist, merge 2 sorted Linkedlist, odd even Linkedlist, file dependency where one file is dependent on others and so on - dfs
    Amazon- sort Linkedlist, stock exchange find profit, custom sorting using comparator, frequent words

    Other companies- 2 sum n 3 sum and its variations, spiral matrix, tree boundary,
    valid parentheses, count of invalid parentheses, 3[ab2[c]] = abccabccabcc,
    search number in bst, longest palindromic substring length, common prefix, number to words
    Jul 31, 2018 2
    • Oath cndjv6wo1
      Ouch sort linked list is a rough one to get right in an interview imo
      Jul 31, 2018
    • Tesla skyflash
      Thanks
      Sep 4, 2018
  • Amazon KwTk33
    Following
    Jul 31, 2018 0
  • Amazon / Eng AWЅ
    Given two inputs, list of strings and a stream of char arrays of fixed size. The list is a dictionary of words, the second is a streaming character grid. Use the word list to match sequences in the character stream, connected orthogonally but can zigzag. Once a word is "matched" those chars can't be used by others words. Output the number of characters unmatched when optimally matching as many chars as possible at each consecutive read from the stream. Also you should match any anagram of the words in the dictionary as well.
    Jul 31, 2018 2
    • Microsoft Ititis
      And the answer is the weed is really strong in Seattle, the interviewer OD'ed.
      Jul 31, 2018
    • Tesla LEETCODER
      Char streams could also be regex right? I think you missed that part.
      Jul 31, 2018
  • Intuit iamami26
    Word break, sudoku validity
    Jul 31, 2018 2
    • For word break were they expecting the bottom up dp solution or was backtracking ok?
      Jul 31, 2018
    • Intuit / Eng
      Bond26

      Intuit Eng

      PRE
      Broadcom Ltd.
      Bond26more
      Either one is fine
      Sep 7, 2018
  • Microsoft Ititis
    It would be more interesting to talk about questions that are not present on public websites and why
    Jul 31, 2018 1
    • West Corporation theocean
      OP
      Please go ahead and share those questions if you have.
      Jul 31, 2018
  • Oath cndjv6wo1
    Surprised I don't see hards in this thread
    Jul 31, 2018 0
  • Microsoft
    Cerdev

    Microsoft

    PRE
    500 Startups
    Cerdevmore
    LinkedList sum + longest sequence of 1s in array + given a dictionary and a matrix find all the words from dictionary in the matrix.
    Jul 31, 2018 0
  • Commvault Java867
    Good post...FANG ppl, plz keep adding so that i know when to appear for msft..😊
    Jul 31, 2018 0
  • Commvault Java867
    stack with two queue, merge sort , knapsack array sum problem , maze
    Jul 31, 2018 0
  • Microsoft k98541
    word square, design photo library (got this question multiple times), minesweeper game, create binary tree and seach.

    Reverse words in string, k-diff pairs, group linked list nodes based on same key, design tic tac toe game
    Jul 31, 2018 0
  • OSIsoft Valdamo
    Word break - got it multiple times

    Variant of binary search

    Given array of 1 and 0, find length of longest subarray of 1. Follow up: what if you can flip a 0 to 1?

    Variant of tree traversal where tree has multiple nodes which is not constant.

    Merge sorted linked list
    Jul 31, 2018 0

Salary
Comparison

    Real time salary information from verified employees