Panda Guru LogoPanda
Guru

Meta | E4 | Phone Screen | US

Round 1

Questions:

  1. Write a class for RunningSumAverage. There is an infinite stream of values and you are asked to give the average of the last k values.

    • Example:
      k = 3 ma = RunningSumAverage(4) # window size is 4 ma.add(1) ma.add(3) ma.add(2) ma.add(5) ma.avg() # returns 11/4 = 2 ma.add(8) ma.avg() # returns 17/4 = 4
  2. Convert a BST to a double linked list (not circular).

  3. Mock Questions:

Candidate's Approach
  • For RunningSumAverage, implemented a class that maintains a running sum and calculates the average of the last k values efficiently.
  • For the BST to double linked list conversion, followed the standard approach of in-order traversal to link nodes in a doubly linked list format.
Interviewer's Feedback

No feedback provided.