鹏博new grad纽约挂经

目前是 New grad, BA CS Top Public School
面的是 New Grad SWE
地点在纽约

Onsite:
2 1-hour interviews each with 2 LC problems.

Interview 1:

  1. Write a system that you can add numbers to and then return a random number out of those.
    ex: [1,4,7,9]
    random num = 2
    returns 7 and resulting list is [1,4,9]
  • Stumbled on this question but was able to get it with a bit of help. In retrospective I should have gotten this question rather easily.
  1. Questions about resume and previous internship that was in NYC
  2. Given 2 strings what is the number of changes to one of them for the strings to become anagrams.
  • Ran out of time but gave a high level approach and interviewer seemed fine with the proposed solution.

They gave a sandwhich to eat for lunch but only gave me 10 minutes between interviews so I didn’t want to wolf it down between my rounds. Just ended up eating it after the interview ended.

Interview 2:
Had a hard time understanding what the interviewer was saying. He barely spoke english.

  1. Top k frequent words (https://leetcode.com/problems/top-k-frequent-words/)
  • Told the interviewer right off the bat that this problem was best solved with PQ but since Python doesnt have a good built in one I’d solve it a different way.
  1. Word search (https://leetcode.com/problems/word-search/)
  • Got most of it but got stuck exiting the recursion

Supposedly if you pass the rounds you make it to a behavioral interview. Knew I didn’t pass when I got asked to leave after the second round. The elevator ride down with the random person escorting me out was super awkward.

When I got to the exit I realized I forgot my sandwhich in the interview room. So I had to go back up like a dumbass. Walked to Central Park and ate my sandwhich there. It wasn’t a good sandwhich (._.)

补充一下店面是:
Set a time with the recruiter for the initial coding phone interview. Got ghosted. No call or email during the set time. I emailed the recruiter and scheduled something for the following week (no sooner times were available).

My actual phone coding screen lasted a bit over an hour and consisted of several problems. Like a lot. I had read people got maybe 1 or 2 questions. I got 5, which frankly I wasn’t expecting.

  1. Write a function to tell whether a string is a plaindrome.
  • I did it iteratively and then the interviewer followed up wanting the recursive solution.
  1. Iterative inorder traversal (https://leetcode.com/problems/binary-tree-inorder-traversal/)
  • I got lucky since I had just done this problem on leetcode a few days before the interview.
  1. Generate a random number between 1-7 given a function that returns a random number between 1-5. Can’t use any other random library to complete function.
  • Had no idea how to do this quite honestly. Told the guy that and moved on.
  1. Remove extra spaces from string in place. Example: “hello__world_there” -> “hello_world” (Spaces are shown as underscores)
  2. Merge and sort contents of very large file (too large to fit into memory)
  • I don’t remember what I said to be honest.

Didn’t think the interview went phenomenally but still passed.

报一个onsite 面经

  • Given an array of cards, how would you shuffle the array in a uniform distribution?
  • Given a streaming method to add volume to a stock, how would you get the top k stocks in volume?
  • Given a N x N grid, find the number of paths (up, down, left, right) given a set number of jumps you can perform and a starting point.
  • Design a system that keeps the average travel time between stations.

也报个纽约上门面经

第一轮

  • Started with brief discussion on past projects.
  • Got asked about the definition of Binary Search Tree followed by coding question on kthLargest Element in a Binary Search Tree.
    Did an iterative reverse inorder traversal while keeping track of the k. Got asked follow up questions to actually think about all the edge cases. Could come up with couple of them.
  • Given an array find indices of k elements which will form minimum sum out of the array. Similiar to k smallest elements in an array.
    Discussed briefly couple of solutions and implemented the max_heap solution and discussed quick select as well.

第二轮

  • Started with specific discussion on a project that I had worked on.
  • Implement a News Feed Api:
    Implement two public methods of news feed.
    publish_story(title, tag) - Publishes a story given the title and a tag is associated with the title.
    get_news_feed(tags) - given a tag list fetch all the titles based on the chronological order of the news articles.
    Gave a solution using HashMap of tag -> LinkedList(titles). And add the latest one in front of the LinkedList.
    get_news_feed then comes down to merging k sorted lists. Brief discussion on alternatives and complexities.
  • Given a skyline of buildings in form of their elevation in an array. Identify the difference between the current building and the next greater building in the array(Next greater element on the right).
    Gave a Stack based solution and went briefly through it.
    Followed by talks on what kind of projects I would love to work at Bloomberg. And couple of Data Structure Questions.

After this was told I am done for the day. PS: The sandwich at lunch is as good as famed to be :slight_smile: