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 7680819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:12:10+00:00 2026-05-31T18:12:10+00:00

Today I had an interview for a developer job and I had to do

  • 0

Today I had an interview for a developer job and I had to do this aptitude test…
I got stuck one 2 questions:

box 1  box 2  box 3
 A      B      C

How to put A in each boxes with only those 4 operator (ADD, SUB,MULT and DIV)?

box 1  box 2  box 3

You have the numbers 1,2 and 3 that can be in either box1 box2 or box3 but we don’t know in which is which… How to put 7 in box 3 ?

Can someone can explain me how to do it ?
ps: syntax is: ADD,1,2,3 => box3 = box1 + box2

Thank you

  • 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-05-31T18:12:11+00:00Added an answer on May 31, 2026 at 6:12 pm

    For the first question, you can set boxes B and C equal to 2A by just storing A + A in each:

    ADD 2, 1, 1
    ADD 3, 1, 1
    

    Now, just subtract A from each box:

    SUB 2, 2, 1
    SUB 3, 3, 1
    

    This results in A stored everywhere. The resulting program is thus

    ADD 2, 1, 1  // Box 1 = A  Box 2 = 2A  Box 3 = C
    ADD 3, 1, 1  // Box 1 = A  Box 2 = 2A  Box 3 = 2A
    SUB 2, 2, 1  // Box 1 = A  Box 2 = A   Box 3 = 2A
    SUB 3, 3, 1  // Box 1 = A  Box 2 = A   Box 3 = A
    

    For the second question, one cute trick would be to divide some box by its own value to put 1 into it. For example:

    DIV 1, 1, 1
    

    Now, let’s put 2 into box 2 by doubling the contents of box 1 and storing it there:

    ADD 2, 1, 1
    

    Now, let’s put 4 into box 3 by doubling the contents of box 2 and storing it there:

    ADD 3, 2, 2
    

    Next, add 2 to box three by adding in the contents of box 3. This makes box 3 hold 6:

    ADD 3, 3, 2
    

    Finally, add 1 to box three by adding in the contents of box 3. This makes box 3 holds 7:

    ADD 3, 3, 1
    

    The total program is thus

    DIV 1, 1, 1   // Box 1 = 1  Box 2 = ?  Box 3 = ?
    ADD 2, 1, 1   // Box 1 = 1  Box 2 = 2  Box 3 = ?
    ADD 3, 2, 2   // Box 1 = 1  Box 2 = 2  Box 3 = 4
    ADD 3, 3, 2   // Box 1 = 1  Box 2 = 2  Box 3 = 6
    ADD 3, 3, 1   // Box 1 = 1  Box 2 = 2  Box 3 = 7
    

    Hope this helps!

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

Sidebar

Related Questions

I heard this today during interview for java developer. I had to list some
I had an interview today and the person asked me this question: How do
This one i had today is a strange one. I have this query in
I had an interview today and was asked this question! code the MS Paint
This question Is a result of various questions I had today about cookies. As
I had an interview today which involved this very question and in order to
Today I had an interview on which I asked candidate quite usual and basic
I had an interview today and every thing was going very good, but then
This is a knowledge topic based on an earlier question I had today. These
In an interview today I mentioned that I had done some jsf work in

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.