Intuting
  • Untitled
  • Algorithm Interviews
    • Common Manager
    • Least # of Activities
    • Real Estate Agent
    • Palindrome Pairs
    • Mirror Tree
    • Ship Cargo in 5 Days
  • Coding Interviews
    • Linux "Find" Command
    • Amazon Locker Service
    • Cache Analysis Service
    • Zookeeper Service
  • System Design Interviews
    • Event Reservation System
Powered by GitBook
On this page

Was this helpful?

  1. Coding Interviews

Cache Analysis Service

#Airbnb #Medium #Coding #Onsite

Question

Given a list of records (as a csv file), analyze the hit rate of each key group (e.g., "user_1" key belongs to "user" key group). There are two different types of operations:

  • get: getting value of a single key.

  • getkq: getting values of multiple keys (noop indicates the end of either "getkq" request or response)

The status of the response is either "ok" (cache hit) or "nokey" (cache miss).

conn_id

magic_code

op_code

status

key

1

req

get

-

user_1

1

resp

get

ok

-

2

req

get

-

listing_1

2

resp

get

nokey

-

1

req

getkq

-

user_1

1

req

getkq

-

listing_2

1

req

noop

-

-

1

resp

getkq

ok

user_1

1

resp

noop

ok

-

The output of the above example should look something like:

  • listing: 0% (0/2)

  • user: 100% (2/2)

PreviousAmazon Locker ServiceNextZookeeper Service

Last updated 5 years ago

Was this helpful?