## Atmel Interview Question for Applications Developers

• 1
of 1 vote

Country: India
Interview Type: In-Person

Comment hidden because of low score. Click to expand.
3
of 3 vote

1,3,9,27

Comment hidden because of low score. Click to expand.
0

Comment hidden because of low score. Click to expand.
1
of 1 vote

Definite Approach:
2. Maximum number accessible with above numbers is 1+3=4.
3. Next number to be accessed 5. Max number until now is 4.
4. Next number is 5+4=9
5. Numbers are 1,3,9. Repeat steps 2,3,4.
Example- Max number accessible=1+3+9=13. Next number to be accessed is 14.
Next number is 13+14=27...
Numbers are 1,3,9,27.

Comment hidden because of low score. Click to expand.
0
of 0 vote

The solution is the same for the balance

if only addition is allowed then 2 pow n and if addition and substraction is allowed then 3 pow n

so in this case

3 pow 0 = 1
3 pow 1 = 3
3pow 2 = 9
3 pow 3 = 27 so you can measure any number between 1 to 40 i.e 1+3+9+27

Comment hidden because of low score. Click to expand.
0
of 0 vote

please explain, how exactly is it happening?
and if we can take any number?
then we should take 1. add it any number of times, subtract it any number of times to get any number. -_-

Comment hidden because of low score. Click to expand.
0
of 0 vote

1 2 3 5, first four prime numbers.

Comment hidden because of low score. Click to expand.
0
of 0 vote

1 2 3 5, first four prime numbers.

Comment hidden because of low score. Click to expand.
0
of 0 vote

``1 3 9 27``

Comment hidden because of low score. Click to expand.
0
of 0 vote

The answer is in the question : 1 3 6 20.
These numbers work from 1 to 30 and also from 30 to 40.

Comment hidden because of low score. Click to expand.
0
of 0 vote

The answer is in the question : 1 3 6 20

Comment hidden because of low score. Click to expand.
0
of 0 vote

1, 3 , 9, 27

Comment hidden because of low score. Click to expand.
0
of 0 vote

Using stacks to process decision trees

``````def find4():
stack = [ [] ]

while len(stack):
nums = stack.pop()

if len(nums)<4:
start = 1
end = 36
if len(nums):
start = nums[-1] + 1
end = end + len(nums)
stack.extend([ nums + [x] for x in range(start,end+1) ])
continue

# verifying
reached = [ 0 ] * 41
total = 0
options = [{'sofar': []}]
while len(options):
decisions = options.pop()
sofar = decisions['sofar']
level = len(sofar)
if 'next' in decisions:
level = level + 1
sofar.append(decisions['next'])

if level<4:
options.append({'sofar': sofar[:], 'next':nums[level]})
options.append({'sofar': sofar[:], 'next':0})
options.append({'sofar': sofar[:], 'next':-nums[level]})

s = sum(sofar)
if s>0 and s<=40 and not reached[s]:
total = total + 1
reached[s]=1

if total>=40:
return nums
break

print find4()``````

Comment hidden because of low score. Click to expand.
-1
of 1 vote

M Sorry ..I didn't get that.. I mean with 1 being there.. any 4 number can be chosen to make it happen.. whats the big deal or a big trick ?

Comment hidden because of low score. Click to expand.
-1
of 1 vote

1,4,8,32

Comment hidden because of low score. Click to expand.
0

But how you get integer 2 and various other integers with these?

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.