Why is it convenient to group binary digits into sets of 4 (from right to left) when converting from binary to hexadecimal?
What is because 16 = 2⁴, so every group of 4 bits corresponds to exactly one hexadecimal digit?
In binary arithmetic, the sum of 1 + 1 produces “0” in the current bit. What else happens?
a carry of 1 to the next more significant bit
In two’s complement binary representation, how do you find the negative version of a positive binary number?
invert all bits and then add 1 to the result
This data structure works on the First-In, First-Out principle — the first element added is the first to be removed.
Queue
This term denotes a node that has no children in a tree.
leaf node
What is the binary representation of the hexadecimal number 7B3?
0111 1011 0011
(7 → 0111, B → 1011, 3 → 0011)
Add the following binary numbers: 1101₂ + 1011₂. What is the correct binary sum?
11000₂
Walk through digit-by-digit addition starting from the right, remembering that 1 + 1 = 0 with carry
If you use an 8-bit two’s complement number, what is the maximum positive decimal value you can represent?
127 (range is –128 to +127)
Name the operation in a stack that adds a new element at the top and the one that removes the top element.
push (add) and pop (remove)
Name the binary tree traversal where you visit root → left subtree → right subtree.
pre-order traversal
Convert the number 101101101₂ to decimal, and then express the result in hexadecimal.
What is 365₁₀ = 16D₁₆?
(256 + 64 + 32 + 8 + 4 + 1 = 365;
365 ÷ 16 → 16D)
Multiply these two binary numbers: 101₂ × 11₂. What is the product in binary?
1111₂
The 8-bit two’s complement binary number 11100101₂ is interpreted as what decimal value?
–27
(flip bits → 0001 1010 + 1 → 0001 1011 = 27)
In contrast to a stack (LIFO), this queue operation removes items from the front of the line, not from the back.
dequeue (remove from front)
Which traversal order of a binary tree prints elements in non-decreasing order if the tree is a BST?
in-order traversal
Perform the binary addition:
10110111₂ + 01101101₂
and express the result in hexadecimal.
10110111
01101101
= 1 00100100₂,
which equals 124₁₆
Compute (111₂ × 101₂) + (110₁₀ converted to binary). Give the final result in binary.
111₂ × 101₂ = 111 × 101 = 100011₂
110₁₀ = 110₂
100011₂ + 110₂ = 100100₂
Compute 1011 0011₂ − 0110 1110₂ using two’s complement (ignore any final carry). What is the binary result?
0100 0101₂
A queue is initially empty. The following operations are performed:
Enqueue(A)
Enqueue(B)
Enqueue(C)
Dequeue()
Enqueue(D)
Dequeue()
C
In a binary search tree containing the values [17, 8, 22], this rule determines where to insert 14.
go left from 17, go right from 8, then insert at the next available node
A hexadecimal number has the form A?F₁₆, where the question mark represents an unknown digit.
Its decimal value is 2815.
Find the missing hexadecimal digit.
2815₁₀ = AFF₁₆
A digital circuit adds two unknown 4-bit binary numbers. The result is 1 0110₂, and the carry into the fifth bit is 1. If one of the numbers is 1011₂, what is the other?
1101₂
You have a 6-bit two’s complement number representing –17. What is its binary representation? (Assume standard two’s complement rules.)
110111₂
(17 = 010001; invert → 101110; +1 → 101111; ensure 6 bits → 110111)
A stack is initially empty. The following operations are performed:
Push(4)
Push(7)
Pop()
Push(9)
Push(2)
Pop()
9
Surprise
You have 500 point