W3
Teacher
Explore
Browse by field
Artificial Intelligence
Accounting & Finance
Information Technology
Show all fields
Interview Q&A
All Interview Questions
Beginner
Intermediate
Advanced
Practice
MCQs
Quizzes
Mock Interviews
About
Light
Dark
Auto
Sign in
Get Started
Search interview questions
Search
24 questions for “I/O & NIO”
Found in 1 field. Select a question to see its full answer.
Matching topics
Java
I/O
&
NIO
15
Information Technology
24 questions in 2 technologies
#
Question
Technology
Topic
Level
1
How does java.
nio
's Channel and Buffer abstraction differ fundamentally from the classic java.io Stream model, and what specific capability does this enable for non-blocking
I/O
?
Java › I/O & NIO
Java
I/O
&
NIO
Advanced
2
How would you implement asynchronous file
I/O
using AsynchronousFileChannel, and how does this differ from both the classic blocking java.io model and
NIO
's Selector-based non-blocking channels?
Java › I/O & NIO
Java
I/O
&
NIO
Advanced
3
How do you read all bytes or all lines of a small-to-medium text file in a single, concise call using modern
NIO
.2 utility methods?
Java › I/O & NIO
Java
I/O
&
NIO
Beginner
4
How does wrapping a FileInputStream in a BufferedInputStream (or FileReader in a BufferedReader) improve
I/O
performance, and what's the mechanism behind this improvement?
Java › I/O & NIO
Java
I/O
&
NIO
Intermediate
5
What are the modern java.
nio
.file utility classes (Path, Files) introduced in Java 7 (
NIO
.2), and how do they improve on the older java.io.File class?
Java › I/O & NIO
Java
I/O
&
NIO
Intermediate
6
How would you use try-with-resources combined with multiple chained
I/O
wrapper classes (like FileInputStream wrapped in BufferedInputStream wrapped in GZIPInputStream) to correctly read a compressed file while ensuring all layers are properly closed?
Java › I/O & NIO
Java
I/O
&
NIO
Intermediate
7
How would you use the WatchService API (java.
nio
.file) to monitor a directory for file system changes (creation, modification, deletion) in real time?
Java › I/O & NIO
Java
I/O
&
NIO
Intermediate
8
How would you implement memory-mapped file
I/O
using MappedByteBuffer, and what performance advantage does this provide for very large files compared to traditional stream-based reading?
Java › I/O & NIO
Java
I/O
&
NIO
Advanced
9
What is the difference between byte streams (InputStream/OutputStream) and character streams (Reader/Writer) in the classic java.io package?
Java › I/O & NIO
Java
I/O
&
NIO
Beginner
10
How would you implement object serialization using ObjectOutputStream/ObjectInputStream, and what does the Serializable marker interface and serialVersionUID actually do?
Java › I/O & NIO
Java
I/O
&
NIO
Intermediate
Show all 24 questions in Information Technology