TOPIC
Data structures and algorithms
These are the same questions found in the library, grouped here by the capability each one mainly examines.
19 questions
A · Professional problem solving and implementation18
- Implement a small cache that evicts the least recently used entry when full. What time cost does each operation need, and which tests do you write first?
- You need a structure that supports fast insert, fast lookup, and ordered iteration. How would you choose among candidates, and what would you give up?
- Implement a retry wrapper that retries by error type, supports a maximum attempt count, backoff, and cancellation, and does not overwhelm the dependency. Define the interface before coding, then explain how to make clocks, waits, and tests deterministic.
- Implement a map with concurrent reads and writes, per-entry expiration, and expired-entry cleanup. How would you define expiration semantics, synchronization boundaries, and deterministic tests?
- Implement a small task queue with concurrent workers, cancellation, and retries; tests must not depend on real sleeps. How would you design the scheduling interface and state transitions?
- Implement an incremental UTF-8 log parser that receives chunks which may split multibyte characters, reorder fields, contain multiple records, or include an exceptionally long line. Define parser state, error recovery, and memory limits, then implement repeatable core logic.
- Design a reusable virtualized list: it renders only visible rows, but selection state must not leak to different data when DOM nodes are recycled. How would you define the interface and test it?
- An object overrides equality but keeps the default hash implementation, causing failed lookups in a hash collection. Explain the equality/hash contract and how you would test it.
- A service’s resident memory is stable, but major page faults, disk I/O, and tail latency rise together. How would you distinguish changes in the working set, mapping behavior, memory pressure, and application access patterns?
- After deployment on a multi-socket machine, threads move across NUMA nodes and memory latency varies. How would you investigate using CPU affinity, memory placement, and scheduling behavior?
- After certificate rotation, short connections work, but some clients fail a handshake when reconnecting or resuming after a long-lived connection closes. How would you distinguish certificate-chain, resumption, connection-pool, and client-cache effects?
- When a mobile device switches from Wi-Fi to cellular, some HTTP/3 requests fail while the session still appears online. How would you investigate path migration, timeouts, and middlebox behavior?
- A program writes a data file before updating its index, but after a power loss the index points to incomplete content. How would you analyze write ordering, flush semantics, and recovery?
- Given a set of records that may exceed memory capacity, process them in batches while allowing the caller to cancel. Describe or implement an interface that bounds memory, locates errors, and starts no new batch after cancellation.
- The input contains time intervals that may overlap or touch, and callers need to find records covering a given instant. Describe or implement a merge and query strategy, including whether endpoints are inclusive.
- Events arrive as a stream, and some duplicates may be hours apart. Memory must remain bounded, and deduplication must survive process restarts. How would you define the time window, persistent state, and false-positive boundaries?
- Given many timestamped records, return the top K by score and preserve earlier items on ties. How would you implement it and analyze edge cases?
- Several sources are individually time-sorted, but total data exceeds memory. Explain how to merge output and handle a source that slows or disconnects temporarily.
No questions in this section match your target. ·