Save 25%
Black Friday: 25% off all plans
— use code
BLACKFRIDAY2026
at checkout. Ends Friday, Dec 4.
Claim the deal
×
Question Bank
Learning
NEW
Pricing
Blog
Forum
HOT
JobRadar
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Confluent
Coding Question
AI Insights
Quick Summary
Retrieve the final n lines from a potentially massive list of strings.
Handle scenarios where the total number of lines is less than n.
Optimize space usage to remain proportional only to n, not the total file size.
What This Tests
Fixed-size buffer management
Queue and deque operations
Space complexity optimization for large inputs
Edge case handling
Common Patterns
Sliding Window
Collapse
Design and implement a function that replicates the behavior of the Linux
tail -n
command.
Hint 1
Hint 2
What Interviewers May Ask Next
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.7-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected