quiz Informatica · 21 questions

Fundamentals of Computer Science

help_outline 21 questions
timer ~11 min
auto_awesome AI-generated
0 / 21
Score : 0%
1

Which of the following statements correctly describes the relationship between a foreign key and a primary key in a relational database?

2

A computer system has a 1 GHz processor. Approximately how many clock cycles does it execute in one millisecond?

3

In a flow‑chart, which geometric symbol is used to represent a decision point that tests a Boolean condition?

4

Which of the following best explains why the statement "a hard disk runs at 300 MHz" is meaningless?

5

When converting the decimal number 525 to binary, which intermediate step is essential in the division‑by‑2 algorithm?

6

Which of the following correctly describes the purpose of the ALU inside a CPU?

7

In the relational algebra, what is the result of applying the natural join operator to two relations that have no matching attribute values?

8

Which of the following best characterises the difference between a ‘key’ and a ‘superkey’ in a relational schema?

9

A programmer writes the C statement `x += 5;`. Which of the following statements is true about its effect?

10

When a process requests a page that is not currently in physical memory, which memory‑management unit component handles the translation to a physical address?

11

Which of the following best explains why the statement “a disk is at 300 MHz” is considered a nonsensical phrase?

12

In the OSI model, which layer is responsible for the physical transmission of bits over a medium?

13

Which of the following statements about the TCP/IP protocol suite is accurate?

14

When a user types the command `fflush(fp);` in a C program, what is the effect of this call?

15

Which of the following best describes the purpose of a ‘passphrase’ in password security?

16

In a relational database, what is the effect of defining a column as `PRIMARY KEY`?

17

Which of the following best explains why the statement “a disk is at 300 MHz” is considered a nonsensical phrase?

18

When converting the binary number 110101 to decimal, which of the following steps is performed first?

19

Which of the following statements about the CPU’s register PC (Program Counter) is correct?

20

In the context of operating systems, what does the term “preemptive scheduling” refer to?

21

Which of the following best describes the purpose of the DNS service on the Internet?

menu_book

Fundamentals of Computer Science

Review key concepts before taking the quiz

Understanding Primary Keys and Foreign Keys in Relational Databases

In a relational database, primary keys and foreign keys are fundamental for maintaining data integrity. A primary key uniquely identifies each row in a table and cannot contain NULL values. A foreign key, on the other hand, creates a link between two tables by referencing the primary key of another table.

  • Uniqueness: The primary key must be unique; the foreign key may contain duplicate values.
  • Nullability: Foreign keys can be NULL, indicating that the relationship is optional.
  • Referential Integrity: For every non‑NULL foreign‑key value, a matching primary‑key value must exist in the referenced table.

When a foreign key points to a non‑existent primary key, the database rejects the operation, preserving consistency across related tables.

How Many Clock Cycles Does a 1 GHz Processor Execute in One Millisecond?

A processor's clock speed indicates how many cycles it completes each second. A 1 GHz (gigahertz) processor performs:

  • 1 GHz = 1 × 109 cycles per second.
  • One millisecond = 1 × 10-3 seconds.

Multiplying the two gives:

1 × 109 × 10-3 = 1 × 106 cycles, or one million clock cycles in a single millisecond.

Flow‑Chart Symbol for Decision Points

Flow‑charts use standardized geometric shapes to convey different types of actions. The symbol that represents a decision point—where a Boolean condition is evaluated—is a diamond‑shaped block. Inside the diamond, the condition is written, and arrows emerging from the shape indicate the possible outcomes (typically “Yes” and “No”).

Why Saying "A Hard Disk Runs at 300 MHz" Is Meaningless

Hard disks and CPUs operate under very different principles, making the statement "a hard disk runs at 300 MHz" confusing for several reasons:

  • Disk speed is measured in rotations per minute (RPM), not in hertz.
  • The term mixes a frequency unit (hertz) with a storage device that does not have a clock signal comparable to a CPU.
  • Even if a disk controller uses a clock, the relevant performance metric for the disk itself is its rotational speed and data transfer rate, not a raw frequency.

Therefore, the statement is nonsensical because it conflates unrelated measurement units and concepts.

Converting Decimal 525 to Binary: The Division‑by‑2 Algorithm

The classic method for converting a decimal number to binary is the division‑by‑2 algorithm. The essential intermediate step is:

  • Recording the remainder after each division by 2. These remainders, read in reverse order, form the binary representation.

For 525, the process looks like this:

525 ÷ 2 = 262 remainder 1
262 ÷ 2 = 131 remainder 0
131 ÷ 2 = 65  remainder 1
65 ÷ 2  = 32  remainder 1
32 ÷ 2  = 16  remainder 0
16 ÷ 2  = 8   remainder 0
8 ÷ 2   = 4   remainder 0
4 ÷ 2   = 2   remainder 0
2 ÷ 2   = 1   remainder 0
1 ÷ 2   = 0   remainder 1

Reading the remainders from bottom to top yields 1000001101₂.

The Role of the Arithmetic Logic Unit (ALU) Inside a CPU

The Arithmetic Logic Unit (ALU) is the computational heart of a processor. Its primary responsibilities include:

  • Performing arithmetic operations such as addition, subtraction, multiplication, and division.
  • Executing logical operations like AND, OR, NOT, and XOR.
  • Carrying out comparison operations (e.g., equal, greater‑than, less‑than) that set status flags for conditional branching.

While the control unit orchestrates instruction flow and the registers hold temporary data, the ALU actually manipulates the data according to the instruction set architecture.

Natural Join with No Matching Attribute Values

In relational algebra, a natural join merges two relations based on all common attribute names, automatically equating those attributes. If the two input relations share no matching attribute values, the result is an empty relation—a table with the appropriate column headings but zero tuples.

This outcome reinforces the principle that joins are essentially filtered Cartesian products: without matching rows, nothing survives the filter.

Key vs. Superkey: Minimality Matters

Both keys and superkeys are sets of attributes that uniquely identify tuples in a relation, but they differ in minimality:

  • A superkey may contain extra attributes beyond what is necessary for uniqueness.
  • A key (also called a candidate key) is a minimal superkey; removing any attribute from it would destroy its uniqueness property.

Understanding this distinction is crucial when designing schemas, normalizing tables, and enforcing integrity constraints.

Putting It All Together: A Mini‑Review

Below is a concise recap of the core concepts covered in this course:

  • Primary vs. Foreign Key: Primary keys are unique and non‑NULL; foreign keys reference primary keys and may be NULL, but any non‑NULL value must exist in the referenced table.
  • Clock Cycles: 1 GHz ≈ 1 million cycles per millisecond.
  • Flow‑Chart Decision Symbol: Diamond shape.
  • Hard Disk Speed Misconception: Disk speed is measured in RPM, not MHz; mixing units creates a meaningless statement.
  • Decimal‑to‑Binary Conversion: Record remainders during repeated division by 2.
  • ALU Function: Executes arithmetic, logical, and comparison operations.
  • Natural Join with No Matches: Produces an empty relation.
  • Key vs. Superkey: A key is a minimal superkey; superkeys can contain additional, unnecessary attributes.

Mastering these fundamentals provides a solid foundation for deeper study in computer science, database design, and digital logic. Continue practicing with real‑world examples, and you’ll soon be comfortable applying these concepts in both academic and professional settings.

Stop highlighting.
Start learning.

Join students who have already generated over 50,000 quizzes on Quizly. It's free to get started.