Paypal Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Implement sliding-window device anomaly
Streaming detection algorithm: Implement a function process_logins(stream) that consumes a time-ordered stream of login events (user_id, ts, device_id...
Search a word in a grid
Given a 2D grid of characters and a target word, determine if the word can be traced by moving up, down, left, or right, using each cell at most once....
Maximize ones with limited flips
Given a binary array and an integer k, return the length of the longest contiguous subarray achievable by flipping at most k zeros to ones. Explain an...
Find k most frequent in linear time
Given an integer array nums and an integer k (1 ≤ k ≤ number of distinct values in nums), return any k values that appear most frequently. Implement a...
Explain Java volatile semantics
What does the volatile keyword guarantee in Java's memory model? Describe visibility, ordering (happens-before), and restrictions on instruction reord...
Contrast TCP vs UDP; detect loss
Contrast TCP and UDP in reliability, ordering, congestion control, connection setup, and overhead. How does TCP detect packet loss and trigger retrans...
Describe std::string copy semantics
In C++, what happens with std::string when you write: std::string a = "123"; std::string b = a; Describe which operations are invoked (copy constructi...
Assess HashMap vs ConcurrentHashMap
Is Java's HashMap thread-safe? Explain why or why not. How does ConcurrentHashMap achieve thread safety and performance (e.g., lock striping, CAS oper...
Compare final, finally, finalize
Compare Java's final keyword, the finally block, and the finalize() method. For each, explain purpose, typical use cases, lifecycle/semantics, and com...
Explain AtomicInteger and ABA problem
How does AtomicInteger implement atomic updates (e.g., via CAS using Unsafe or VarHandles)? What is the ABA problem in lock-free algorithms, how can i...
Compare write-back vs write-through caches
Compare write-back and write-through caching policies. Explain how each handles writes, coherence, durability, latency, and bandwidth; discuss typical...
Explain HashMap internals and collisions
In Java, describe the underlying data structures used by HashMap (e.g., array of buckets, linked lists vs tree bins) and how they evolved across Java ...
Count Word Frequency and Print Top Three Words
Scenario First-round Python coding screening Question Using only basic Python, write a function that receives a list of strings and returns a dictiona...
Generate Bigrams Using Python List Comprehension and Zip
Scenario Live Python exercise: generate all bigrams from an input string and iteratively optimize the solution. Question Write a Python function that ...