Amazon Interview Question for Software Engineer / Developers






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

bool isSet = (num & (1<<8)

- Jasmeet April 13, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

((a>>8)>> 1) & 1

- Messi April 13, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Doesnt sound like amazon question........2 easy

- Hawk April 14, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

((a>>8)&1)

- Anonymous April 15, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

a & 2^8

- nishant30 April 21, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

set(int x)
{
int n=9;
n=1<<(9-1);
if((x&n))
printf("Bit not set:1");
else
printf("Bit set:0");
}

- Anonymous April 23, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

If condition the other way...
if(!(x&n)) //if result zero
printf("Bit not set:1");
else //if result one
printf("Bit set:0");

- AmitG November 16, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

int n;
n=1<<8;
if (x&n) then true

- Anonymous April 25, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

is_set(int val) {
 
   unsigned int mask = 0x100;

   if( val & mask ) 
            printf("bit is set");
   else 
            printf( "bit is not set");
 }

- Dsk July 06, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

return num & 0x00000100

- Anonymous December 28, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

For solving the above algorithm we need to shift the given binary representation of the number 8 to the right and then while we reach on the 9th bit we will check for the condition that if(n&1 == 1) then return true else return false.

- swapnilkant11 July 21, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include <stdio.h>

int main()
{
	int number = 0;

	printf("enter any number :");
	scanf("%d", &number);

	printf("\n");
	if (number & (1<<8))
		printf("9th bit set\n");
	else 
		printf("9th bit unset\n");

	return 0;
}

- sukanya January 03, 2021 | Flag Reply


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