Adobe Interview Question for Software Engineer / Developers






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

Which instruction set?

Also, count 1st n numbers? Isn't the answer n?

- LOLer July 31, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think the OP meant count 1's in numbers.

- Anonymous August 01, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

lol... the count is itself "n"...what to count then ...WTF ...either there's something missing or question is disgustingly dumb!

- googler August 05, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

are you asking for SUM of 1 to N number. Is it correct?

- IQ August 29, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

In question , they asked that give the number of 1's in given number.

for example : number = 10 the 00001010 so number of 1's = 2

I will write C code we can convert later on

int numberofone = 0;

If ( number > 0 )
numberofone = 1;

while ( number > 0 )
{
if ( number & (number - 1 ) )
numberofone++;
number = number >> 1;
}

return numberofone;

- Deepak Garg February 17, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In question , they asked that give the number of 1's in given number.

for example : number = 10 the 00001010 so number of 1's = 2

I will write C code we can convert later on

int numberofone = 0;

If ( number > 0 )
numberofone = 1;

while ( number > 0 )
{
if ( number & (number - 1 ) )
numberofone++;
number = number >> 1;
}

return numberofone;

- Deepak Garg February 17, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

int fun(int i)
{
int j=0,count=0;

while(i!=0)
{
j = i & 1;

if(j%2 != 0)
count++;
i = i>>1;
}

return count;
}

int main()
{
int i=0,j=0;

printf("\n Enter Number \n");
scanf("%d",&i);
j = fun(i);
printf("\n Number of 1's are %d\n",j);
return 0;
}

- Ashutosh Singh May 07, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

ALP to find some of first n numbers :

LDA N
MOV C,A
LDA 0
MOV B,A
MOV A,C

L1:
JZ EXIT
MOV C,A
L2:
INR B
DJNZ L2
MOV A,C
DJNZ L1

EXIT:
MOV A,B

- fabregas March 05, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

sum*

- fabregas March 05, 2011 | 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