class OrderedIntStream:
The round: one Sierra phone screen report. Three coding parts on streams of ints. You write and run your own tests. The interviewer said there are no follow-ups beyond the three parts, and only said "ok, next part" between them. The candidate finished the code and could run their tests, and was later rejected with no reason given. Separately, they wondered whether their tests had been complete. Three graded parts.
Interface and rules (ours)
The report gives one short line per part: the class name and what it outputs. Everything below, from the method names to the rules in each part, is our reading of those lines. Confirm each rule with the interviewer. Here every stream has the same two methods:
def has_next(self) -> bool: ... # True if next() has a value; does not consume it
def next(self) -> int: ... # the next value; raises StopIteration when empty
Part 1 — OrderedIntStream over a list
class OrderedIntStream:
def __init__(self, nums: list[int]): ...
nums in order, one per next() call. Here "in order" means ascending: the constructor sorts a copy. If the list is already sorted, emitting it as given is the same thing.Notes: the report's wording is short. These are ours: the method names, StopIteration, sorting a copy in Part 1, starting Part 2 at k (not 0) and the ValueError rule, and in Part 3 keeping duplicates, the unique flag, supporting infinite and nested inputs. Ask about each before coding.
One report, from a Sierra phone screen in February 2026. The three parts are short, and the interviewer said there are no follow-ups: read the problem carefully and write it. You write and run your own tests. The interviewer gave no signal during the round beyond "ok, next part". The candidate finished the code, could run their tests, and was later rejected with no reason. Separately, they wondered whether their tests had been complete. With a problem this small, the tests and the clarifying questions are probably where you are judged, but that is a guess from one report.
What the report says: three short parts and no follow-ups; the interviewer said to read the problem carefully and write it. You write and run your own tests. The candidate finished the code and was later rejected with no reason; separately, they wondered whether their tests had been complete.
Common mistakes (ours, not reported): has_next() that consumes a value; draining an input stream inside the merge, which hangs on an infinite stream; pushing (value, stream) onto the heap so equal values compare streams; storing every multiple in a list; testing only the happy path.
Edge cases to test (ours): an empty list; has_next() called twice; next() after the end; duplicates and negatives; an infinite input to the merge; duplicates across merged streams; a merge of no streams; a merge used as an input to another merge.
Alternative approaches (ours): the Python iterator protocol (iter and next) instead of has_next() and next(); for two inputs, a two-pointer merge with one buffered head per stream instead of a heap.
Also reported as OrderedIntStream · MultiplesStream · MergeStream
The round: one Sierra phone screen report. Three coding parts on streams of ints. You write and run your own tests. The interviewer said there are no follow-ups beyond the three parts, and only said "ok, next part" between them. The candidate finished the code and could run their tests, and was later rejected with no reason given. Separately, they wondered whether their tests had been complete. Three graded parts.
Interface and rules (ours)
The report gives one short line per part: the class name and what it outputs. Everything below, from the method names to the rules in each part, is our reading of those lines. Confirm each rule with the interviewer. Here every stream has the same two methods:
def has_next(self) -> bool: ... # True if next() has a value; does not consume it
def next(self) -> int: ... # the next value; raises StopIteration when empty
Part 1 — OrderedIntStream over a list
class OrderedIntStream:
def __init__(self, nums: list[int]): ...
nums in order, one per next() call. Here "in order" means ascending: the constructor sorts a copy. If the list is already sorted, emitting it as given is the same thing.Part 2 — MultiplesStream of an int
class MultiplesStream:
def __init__(self, k: int): ...
k in order: k, 2k, 3k, .... It never ends, so has_next() is always True.k must be a positive int; anything else raises ValueError.Part 3 — MergeStream of a list of streams
class MergeStream:
def __init__(self, streams: list, unique: bool = False): ...
has_next() and next(): an OrderedIntStream, a MultiplesStream, or another MergeStream.6 comes out twice when merging multiples of 2 and 3). unique=True is the other reading: a value equal to the one before it is dropped.Notes: the report's wording is short. These are ours: the method names, StopIteration, sorting a copy in Part 1, starting Part 2 at k (not 0) and the ValueError rule, and in Part 3 keeping duplicates, the unique flag, supporting infinite and nested inputs. Ask about each before coding.
What the report says: three short parts and no follow-ups; the interviewer said to read the problem carefully and write it. You write and run your own tests. The candidate finished the code and was later rejected with no reason; separately, they wondered whether their tests had been complete.
Common mistakes (ours, not reported): has_next() that consumes a value; draining an input stream inside the merge, which hangs on an infinite stream; pushing (value, stream) onto the heap so equal values compare streams; storing every multiple in a list; testing only the happy path.
Edge cases to test (ours): an empty list; has_next() called twice; next() after the end; duplicates and negatives; an infinite input to the merge; duplicates across merged streams; a merge of no streams; a merge used as an input to another merge.
Alternative approaches (ours): the Python iterator protocol (iter and next) instead of has_next() and next(); for two inputs, a two-pointer merge with one buffered head per stream instead of a heap.
If you have had this round, tell us how close this page was. It is how we keep the pages accurate.