Facebook | Phone | Front End Engineer
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-01-31Added By Anonymous
Source: Link
Company: Meta (Facebook)
Role: Front End Engineer
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
1. Write a class called DOMStore that stores a Node and a value (reimplement Map). DOMStore contains the following functions:javascript
has(node) // returns boolean
get(node) // returns node or undefined
set(node, value) // "upsert", update or insert
2. Flatten an array with unknown depth (reimplement .flat(Infinity)).
a. Write it both recursively and iteratively.