
DSA + System Design - 6

Quiz
•
Computers
•
Professional Development
•
Medium
Puneet Kansal
Used 1+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following expressions correctly checks if a number n is a power of two?
n & (n - 1) == 0
n & (n + 1) == 0
n | (n - 1) == 0
n ^ (n - 1) == 0
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does the bitwise NOT operation (~) do to the binary representation of a number?
Inverts the bits
Shifts the bits to the right
Shifts the bits to the left
Sets all bits to 1
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does the expression (x >> 1) do to the integer x?
Divides x by 2
Multiplies x by 2
Adds 2 to x
Subtracts 2 from x
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following is true for any integer n when n is even?
n & 1 == 1
n & 1 == 0
n | 1 == 0
n ^ 1 == 0
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the binary result of the expression 5 ^ 3?
0001
0010
0110
1000
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which operation would you use to swap the values of two variables a and b without using a temporary variable?
a = a ^ b; b = a ^ b; a = a ^ b
a = a & b; b = a & b; a = a & b
a = a | b; b = a | b; a = a | b
a = a + b; b = a - b; a = a - b
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the result of 7 | 2 in binary?
0001
0010
0111
1110
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Les raccourcis clavier en bureautique

Quiz
•
Professional Development
12 questions
Computer Networking Fundamentals

Quiz
•
Professional Development
13 questions
BlackBoard UCV

Quiz
•
KG - Professional Dev...
13 questions
Phyton Lección 2

Quiz
•
Professional Development
15 questions
unit-5 test-1

Quiz
•
Professional Development
10 questions
Tin học lớp 5 phần mềm Logo

Quiz
•
Professional Development
15 questions
C1 Procesador de texto

Quiz
•
Professional Development
14 questions
ModAng

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade