Implement tail -n (print last N lines of a file)
Asked at Confluent · Coding Questions · Difficulty: Medium · Last asked Jul 19, 2026
Given a text file, print the last **N** lines of the file. Lines are separated by the newline character `\n`.
Loading the problem…
More Confluent interview questions
- Design Scalable TinyURL Service with One-to-One URL Mapping
- Design a podcast publishing and feed system
- Phrase search over multiple documents
- Warehouse Loading: Reach TargetWeight at Any Point with Reordered +/- Weights
- Pairwise Modulo Checksum: Sum of i mod j + j mod i up to n
- Random Queue ADT + Equality + Thread Safety + RLE-backed Comparison