Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8784037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:58:59+00:00 2026-06-13T20:58:59+00:00

I was asked the following question in an interview. I don’t have any idea

  • 0

I was asked the following question in an interview. I don’t have any idea about how to solve this. Any suggestions?

Given the start and an ending integer as user input,
generate all integers with the following property.

Example:

123 , 1+2 = 3 , valid number
121224 12+12 = 24 , valid number
1235 1+2 = 3 , 2+3 = 5 , valid number
125 1+2 <5 , invalid number
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:59:01+00:00Added an answer on June 13, 2026 at 8:59 pm

    A couple of ways to accomplish this are:

    1. Test every number in the input range to see if it qualifies.

    2. Generate only those numbers that qualify. Use a nested loop for the two starting values, append the sum of the loop indexes to the loop indexes to come up with the qualifying number. Exit the inner loop when the appended number is past the upper limit.

    The second method might be more computationally efficient, but the first method is simpler to write and maintain and is O(n).

    I don’t know what the interviewer is looking for, but I would suspect the ability to communicate is more important than the answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently in a job interview I was asked this following question (for Java): Given:
I got asked the following question in an interview while talking about concurrency in
I was asked the following question during phone interview I had: Given the following
Recently I was asked the following interview question: You have two sets of numbers
I was asked the following question in an interview: Is there any way in
I was asked in an interview this question so I answered with the following:
I have been asked a question in an interview about interfaces. I am not
Interview Question I have been asked this question in an interview, and the answer
I have been asked in an interview the following question: What is the default
I was asked this question in interview. Which of the following is better to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.