Lyft·Software Engineer·Technical Phone Screen
- Given a large UTF-8 text file, write a program that reads the K-th non-empty line without loading the entire file into memory. How do you handle edge cases like fewer than K non-empty lines, blank lines, and trailing newlines?
“The core read-and-count loop took me maybe five minutes to sketch out.”