NCC Past Contests and Practice Questions
Practice Questions
Please note: These questions represents simplified versions of questions that may appear on the actual challenge, and they are intended to give an example of the type of logical operations that will be required.
1. Basic Logic Gate Problem
Introduction: Computers use logic gates to make decisions. An OR gate outputs True if at least one input is True.
Question: What is the output of an OR gate if the inputs are True and False?
Options: A) True
B) False
C) None
D) Both True and False
Solution
Solution: An OR gate outputs True if at least one of the inputs is True. Here, the output is True.
Correct Answer: A) True
2. Data Storage Calculation Problem
Question: A text file contains 200 lines, and each line has 50 characters. How many total characters are in the file?
Options: A) 10,000 characters
B) 8,000 characters
C) 12,000 characters
D) 6,000 characters
Solution
Solution:
Total characters = 200 lines × 50 characters/line = 10,000 characters.
Correct Answer: A) 10,000 characters
Explanation: By multiplying the number of lines by the number of characters per line, you find the total number of characters in the file.
3. Assembly Problem
Question: A program runs the following steps:
[0]: Start
[1]: Add 4
[2]: If the value is greater than 5, go to step 4
[3]: Subtract 2
[4]: Add 1
[5]: End
If the starting value is 3, how many steps are executed in total?
Options:
A) 3
B) 4
C) 5
D) 6
Solution
Solution:
Step 0: Start.
Step 1: Add 4 → 3 + 4 = 7.
Step 2: The value (7) > 5, so jump to step 4.
Step 4: Add 1 → 7 + 1 = 8.
Step 5: End.
Total steps executed: 5 (including the final step to end the program).
Correct Answer: C) 5
4. Conditional Logic Problem
Question: A program runs the following logic:
If a number is greater than 10, subtract 4.
Otherwise, add 6.
What is the result when the input number is 8?
Options:
A) 2
B) 14
C) 4
D) 6
Solution
Solution: Since 8 is not greater than 10, the program adds 6:
8 + 6 = 14
Correct Answer: B) 14
Explanation: The input number 8 is not greater than 10, so the 'otherwise' condition applies, adding 6 to give a result of 14.