1. Which statement about finally is true?
finally runs after try or catch for cleanup, regardless of normal or exceptional flow. It can be skipped in rare cases like System.exit, JVM crash, or power loss.
Get the Preplance app for a seamless learning experience. Practice offline, get daily streaks, and stay ahead with real-time interview updates.
Get it on
Google Play
4.9/5 Rating on Store
Netflix · Java
Practice Java questions specifically asked in Netflix interviews – ideal for online test preparation, technical rounds and final HR discussions.
Questions
10
Tagged for this company + subject
Company
Netflix
View company-wise questions
Subject
Java
Explore topic-wise practice
Go through each question and its explanation. Use this page for targeted revision just before your Netflix Java round.
finally runs after try or catch for cleanup, regardless of normal or exceptional flow. It can be skipped in rare cases like System.exit, JVM crash, or power loss.
For complete preparation, combine this company + subject page with full company-wise practice and subject-wise practice. You can also explore other companies and topics from the links below.
Exception translation means catching a low-level exception and throwing a higher-level, more meaningful one. It’s appropriate when moving across layers—for example, converting SQLException into a domain-specific DataAccessException. Preserve the cause using the constructor so the original stack trace remains available.
LinkedHashMap preserves a predictable iteration order: insertion order by default, or access order when configured for LRU-style caches.
For full queues: add throws IllegalStateException, offer returns false, offer(timeout) waits up to the timeout, and put blocks until space is available.
If an object never escapes a method or thread, the JIT can allocate it on the stack (scalar replacement) and remove unnecessary synchronization, reducing GC pressure and contention.
High allocation rates trigger more frequent young GCs and fill survivor/old regions faster, increasing pauses and promotion failures. Fewer temporary objects mean fewer barriers and less pressure on remembered sets. Lower churn gives the GC time to work concurrently, reducing pause frequency and tail latencies.
Use `map` for one-to-one transformations. Use `flatMap` for one-to-many where inner streams or collections are concatenated into a single stream.
Side effects (e.g., mutating external state in map/filter) break referential transparency, hinder parallelization, and cause subtle bugs. Prefer pure functions and let `collect` build results. If you must observe, use `peek` only for diagnostics; for imperative accumulation, a simple loop may be clearer.
WatchService lets you register a directory for change events. It’s best effort, may coalesce events, and is not a content diff tool or replication system.
Blocking queues coordinate producers and consumers. put waits for space; take waits for data. offer/add/remove have different, non-blocking behaviors and may fail or throw.