Algorithm · Amazon · Medium
Requirements Each incoming record has the form readBook(user_id, book_id, current_pos_sec, book_duration_sec). Treat a user's event for a particular book as abusive only when both of the following are true: current_pos_sec >= 0.95 * book_duration_sec, meaning the user is within the final 5% of the book. No earlier event for that same user and book reached 0.10 * book_duration_sec; in other words, the user skipped forward without listening through the opening 10%. Mark a book…
Checking your access…