Atmel Interview Question for Applications Developers


Country: India
Interview Type: In-Person




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

1,3,9,27

- anonymous October 01, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

can you please your approach to get these 4 numbers :)

- PKT October 05, 2014 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Definite Approach:
1. Start with 1,3.
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.

- kanhaiya.baranwal October 08, 2014 | Flag Reply
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

- Ram M Singh October 12, 2014 | Flag Reply
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. -_-

- neha October 13, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1 2 3 5, first four prime numbers.

- Anonymous November 13, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1 2 3 5, first four prime numbers.

- Anonymous November 13, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1 3 9 27

- simon.zhangsm December 10, 2014 | Flag Reply
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.

- joseph March 02, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The answer is in the question : 1 3 6 20

- joseph March 02, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1, 3 , 9, 27

- anik2137 April 09, 2015 | Flag Reply
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()

- Chuck April 14, 2015 | Flag Reply
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 ?

- hprem991 October 03, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

1,4,8,32

- brehme October 06, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

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

- amitsahu78 October 06, 2014 | Flag


Add a Comment
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.

Learn More

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.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More