← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Pinterest wants to send an alert when a newly created pin matches a user's keyword interests.
Given:
pins: a list of pins, each with id, description, and usernameusers: a list of usernames who should receive alertskeywords: a list of keywords to match (case-insensitive substring match against the description)Return a list of pin IDs (in input order) that should trigger an alert. A pin triggers an alert when:
username is in the users list, ANDdescription contains any of the keywords as a whole-word substring, ignoring punctuation.Whole-word definition: the keyword must appear bordered by non-letter characters (or string boundaries). The match is case-insensitive.
Examples:
pin description: "I love candy and cake" keywords=["candy"] -> match pin description: "I have a candle" keywords=["can"] -> NO match (substring, not a whole word) pin description: "Eat candy! Now" keywords=["candy"] -> match (punctuation is a non-letter boundary)
Follow-up Questions: