Skip to main content
All Questions

Implement a C++ class, constructed from an istream, whose begin() and end() return input iterators over the valid integers in a file of one value per line.

Unlock detailed company stats for this questionUpgrade
A file holds integers one per line. Implement a C++ class Solution, constructed from an istream, that exposes begin() and end() returning input iterators over the valid integers. A valid line is an optional sign followed by digits without leading zeros, in the range [-1,000,000,000, 1,000,000,000], with optional spaces before and after; any other line (e.g. '2u1', '23.9', '#12', '00', '++1', '2000000000') is a comment and must be skipped.

Community answers

No answers contributed by the community yet.

Related courses

Course

Behavioral Interviews: A Practical Guide for Engineers

Get offers at the level you deserve. Prep for senior+ behavioral interviews at FAANG and Tier-1 companies. Made with staff and principal engineers from Meta, Netflix, Google, and more. Avoid downleveling, elevate past projects, and stop sounding like a robot.

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.