← Questions
Field pattern queries over key-value API records
0
I was asked this
No reports yet. Sign in to say where you were asked it.
API records are strings like method=get;path=users. Answer many queries of the form key=pattern, each true when some record has that key with a matching value. A pattern is an exact value, a prefix followed by *, or * alone for any value. Matching is case-sensitive.
Parse the records once and build an index so each query looks only at the values stored under its key; prefix queries should not scan every value either. Discuss the trade-off between a sorted list with binary search and a trie per key.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
