This was my second coding interview, after passing the earlier coding round with the hiring manager. It was on CodeSignal. The code had to run, but there weren't any prewritten test cases that my code had to pass. That was pretty nice. It seemed that as long as it compiled, writing one or two simple tests with print statements was enough.
The problem was to implement metricDB. A metric class had a few fields, such as name, timestamp, value, and tags, which were key-value pairs. Then I had to write a metricsDB class implementing two methods: recordMetric and search.
The inputs to search were String name, Map tags, and int n. It had to return the most recent n metrics matching both name and tags.
By the time I finished, there wasn't much time left. They asked about time complexity, then the interview ended. I don't know whether there were any further follow-ups.
Discussion
Loading comments…