LC - Datadog Flashcards
Buffered file
You know it
Logs and queries
Build query hash
Query hash to Id
Inverted index - word to query Id
For each word in log - for each query Id that contains it, add it to a list for the query Id
For each query Id, build a hash with all the words in the log and compare with original hash to Id dictionary
Maximum tree path sum
Post order DFS
Frequency of words
Dictionary
“”.join(c.lower() for c in s if c not in string.punctuation)
File system
Basic recursion.
isDir()
findList()
High performance filters
Build map from index to tags list
Build inverted index from tags to list of indexes
For each tag in the filter, add to the set of Ids that contain the tag.
Iterate through the set, check if the tag list contains all tags, and extend the result list