CS-OA cs-vo Faang

PayPal面经-PayPal VO真题-PayPal VO real questions-PayPal interview


PayPal's interview process is very standard, very close to that of the FAANG companies. It requires two algorithm questions in 45 minutes. The algorithm question is very easy. We will spend a lot of time on the second coding question. The following is a real interview Coding questions that appear in .

Cache Queries


Implement a prototype of a simple cache query handler.

There are n data entries stored in the cache. Each entry is of the form {timestamp, key, value}, where timestamp represents the time at which the entry was stored in the cache, key represents the ID assigned to the cache entry, and value represents the data value of the entry, an integer represented as a string. The keys assigned to the cache entries may not be unique. The cache query handler receives q query requests, where each query is of the form {key, timestamp}, where key represents the ID of the cache entry to find, and timestamp represents the time the entry was added.

Given two 2D arrays of strings, cache_entries, and queries, of sizes n x 3 and q x 2 respectively, return an array of size q with the data values for each query.


cache_entries = [["12:30:22", "a2er5i80", "125"], ["09:07:47", "i0o9ju56", "341"], ["01:23:09", "a2er5i80", "764"]] queries = [["a2er5i80", "01:23:09"], ["i0o9ju56", "09:07:47"]]

  • queries[0] corresponds to the data entry at index 2, with value = "764"
  • queries[1] corresponds to the data entry at index 1, with value = "341"
Event TypeDataCacheQuery Result
Update cache["09:07:47", "i0o9ju56", "341"]i0o9ju56 = 341-
Query["i0o9ju56", "09:07:47"]i0o9ju56 = 341341
Update["12:30:22", "a2er5i80", "125"]i0o9ju56 = 341, a2er5i80 = 125-
Update Cache["01:23:09", "a2er5i80", "764"]i0o9ju56 = 341, a2er5i80 = 764-
Query["a2er5i80", "01:23:09"]i0o9ju56 = 341, a2er5i80 = 764764

Return [764, 341].


First, I read the question description carefully to make sure I fully understood what the question required. This includes understanding the cached data structure, the format of the query, and ultimately the desired output. In this question, I noticed that we need to deal with two arrays: cache_entries (cache entries) and queries (queries).


Second, I wrote an algorithm to populate this hash map, and then for each query, I constructed its unique identifier and looked up in the hash map to get the data value. If the corresponding key is not found in the map, I will return a specific error code or a null value.


Before presenting my solution to the interviewer, make sure I consider multiple aspects of the problem and be able to articulate my solution clearly.



We can provide special services such as interview assistance and proxy interviews as needed to help you secure your offer

Finding a job is not something that can be achieved overnight. If younger students want to have an internship experience in a large company, they need to make sufficient preparations in advance.

【 Go 】 Learn about job search services and comprehensively enhance your job search competitiveness!

Leave a Reply

Your email address will not be published. Required fields are marked *