Available question text
Given an API read4 that reads up to 4 characters from a file into a temporary buffer, implement read(buf, n) to copy up to n characters into the destination buffer using repeated read4 calls, correctly handling partial reads at EOF and returning the actual number of characters read.
Related questions
Continue with questions that share topics or the same question type.
- Read N Characters Given read4 II - Call Multiple Times
Coding · Array · Interactive · Simulation
- Count Unique Characters of All Substrings of a Given String
Coding
- Given a basic API for a low level disk drive, implement a file system that can read and write.
Coding
- The "Alien Dictionary" problem is a classic LeetCode question (specifically LeetCode Problem 269) that requires determining the alphabetical order of characters in a new language given a list of words sorted according to that language's rules. This is typically solved using graph theory and topological sorting (Kahn's algorithm or DFS).
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Google
Leetcode 157. Read N Characters Given Read4
Reported Dec 25, 2024 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source