Epic Interview Question: Write a function which, given... | Glassdoor

Interview Question

Software Developer Interview Madison, WI

Write a function which, given n, prints all well-ordered

  integers of n digits. A well ordered number is one where the value of the i-th digit is less than the value of the i+1 digit.
Tags:
technical, programming
Answer

Interview Answer

5 Answers

0

What does it mean by "all well-ordered integers"? For example, if n=3, then should "all well-ordered integers" look like this:
1, 2, 3, 12, 13, 23, 123?

Anonymous on Oct 30, 2009
1

@anonymous: it means print all integers of 'n' digits, where the digits are in ascending order:
for n=3: 123, 234, 345 ...789

dopey on Jun 6, 2011
0

Are you sure? There is no upper bound then. What is your upper bound? How do you determine the upper bound? I believe you misunderstood the question.

Anonymous on Oct 26, 2012
0

123, 124, 125 ... 129, 134, 135 ...139 ...234 ... 289 ...789

eric on Jan 14, 2015
0

The upper bound is the n digit not with all 9s

Anonymous on Mar 30, 2018

Add Answers or Comments

To comment on this, Sign In or Sign Up.