Had onsite for Software Engineer II on a team within Marketplace organization. Technical questions were very fair (id say medium difficulty) and used common DSA (not any esoteric stuff).
You are given a class called AdEvent, which contains attributes of uuid (id for ad), timestamp (represented in YYYY-MM-DD format), but you can make it some integer value for easier testing, and event_type (either impression or click).
Write the following functions:
consume_ad_event(ad_event): Take in an ad event and consume itget_historical_metrics(id): Given an ad id, return an output that looks like the following (note that the 1, 2, 3 in the test example are timestamp)1: impressions - 5, clicks - 5
2: impressions - 10, clicks - 2
3: impressions - 15, clicks - 20,
....has_low_performance(id, timestamp): Given an ad id along with a timestamp, identify if there were at least X impressions without any click in the last Y days. This signifies that an ad is receiving views, but no conversion! X and Y are hardcoded constants.You are given the following input:
equations: an array with entry of format [ai, bi]. ai, bi are variablesvalues: an array where values[i] = ai / biqueries: a list of lists represented in similar way to equationsFor each query, compute the result. If unable to, return -1. return a list of the results of the queries
Note that this question is apparently this problem on leetcode: https://leetcode.com/problems/evaluate-division/description/