Panda Guru LogoPanda
Guru

Meta E4 Onsite|Coding - Pass/Fail?

Round 1

Questions:

Question

Find the number of connections needed to connect all computers.

Input: [[a,b],[b,c],[d,e]]
Output: 1

Candidate's Approach

Solved this using DFS.

Interviewer's Feedback

No feedback provided.


Round 2

Questions:

Question

Perform string multiplication.

Input: a = "10", b = "5"
Output: "50"

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 3

Questions:

Question

Find a random index of the maximum value in an array.

Input: [1, 2, -1, 4, 5, 5]
Output: Randomly return one of the indices for 4 or 5.

Candidate's Approach

Solved this optimally.

Interviewer's Feedback

No feedback provided.


Round 4

Questions:

Question

Implement insert() and getMedian() for a sorted list.

Input: insert(3), insert(1), insert(2)
Output: getMedian() = 2

Candidate's Approach

Initially solved by sorting the list after every insertion but later optimized it by maintaining the middle value(s).

Interviewer's Feedback

No feedback provided.