Paypal Software Engineer Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
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...
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 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...
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 ...
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...