Meta
More Experiences
Meta Phonescreen
August 13, 2025 • 5 reads
Summary
I had a phone interview at Meta where I successfully solved two data structure and algorithm problems, and I am currently awaiting a reply.
Full Experience
Had a phone interview 1.https://leetcode.com/problems/swap-nodes-in-pairs/description/ 2.https://leetcode.com/problems/insert-delete-getrandom-o1/
I was able to solve both questions awaiting for reply
Hope this helps for other users
Interview Questions (2)
Q1
Swap Nodes in Pairs
Data Structures & AlgorithmsMedium
Q2
Insert Delete GetRandom O(1)
Data Structures & AlgorithmsMedium
Implement the RandomizedSet class:
RandomizedSet()Initializes theRandomizedSetobject.bool insert(int val)Inserts an itemvalinto the set if not present. Returnstrueif the item was not present,falseotherwise.bool remove(int val)Removes an itemvalfrom the set if present. Returnstrueif the item was present,falseotherwise.int getRandom()Returns a random element from the current set of elements (at least one element must exist when this method is called). Each element must have the same probability of being returned. I must implement the functions of the class such that each function works in averageO(1)time complexity.