Docsity

NOCTI Computer Programming Ultimate Exam, Exams of Technology

Toggle sidebar
bg1
NOCTI Computer Programming Ultimate
Exam
**Question 1. Which programming paradigm emphasizes objects that combine data and behavior?**
A) Procedural programming
B) Functional programming
C) Object‑Oriented programming
D) Logic programming
Answer: C
Explanation: OOP groups data (attributes) and methods (behaviors) into objects, promoting
encapsulation and reuse.
**Question 2. In a procedural language, which of the following is the primary unit of code
organization?**
A) Class
B) Function (or procedure)
C) Module
D) Interface
Answer: B
Explanation: Procedural languages organize code around functions or procedures that execute
sequential steps.
**Question 3. Which hardware platform is most appropriate for running a high‑throughput database
server?**
A) Smartphone
B) Tablet
C) Desktop PC
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c

Partial preview of the text

Download NOCTI Computer Programming Ultimate Exam and more Exams Technology in PDF only on Docsity!

Exam

Question 1. Which programming paradigm emphasizes objects that combine data and behavior? A) Procedural programming B) Functional programming C) Object‑Oriented programming D) Logic programming Answer: C Explanation: OOP groups data (attributes) and methods (behaviors) into objects, promoting encapsulation and reuse. Question 2. In a procedural language, which of the following is the primary unit of code organization? A) Class B) Function (or procedure) C) Module D) Interface Answer: B Explanation: Procedural languages organize code around functions or procedures that execute sequential steps. Question 3. Which hardware platform is most appropriate for running a high‑throughput database server? A) Smartphone B) Tablet C) Desktop PC

Exam

D) Rack‑mount server Answer: D Explanation: Rack‑mount servers provide the CPU, memory, storage, and network capabilities needed for intensive database workloads. Question 4. The Java Virtual Machine (JVM) is an example of which type of runtime environment? A) Native OS kernel B) Managed execution environment C) Browser plug‑in D) Embedded firmware Answer: B Explanation: The JVM abstracts the underlying OS and hardware, managing memory and providing bytecode execution. Question 5. Which UI principle prioritizes reducing the number of steps a user must take to complete a task? A) Consistency B) Learnability C) Efficiency of use D) Aesthetic integrity Answer: C Explanation: Efficiency of use focuses on minimizing effort and time for frequent users. Question 6. In the data hierarchy, the smallest addressable unit of storage is the:

Exam

Question 9. Under the Copyright Act of 1976, which of the following is protected? A) Ideas alone B) Functional algorithms C) Original expression of ideas in a tangible medium D. Public domain facts Answer: C Explanation: Copyright protects the expression, not the underlying ideas or facts. Question 10. Which type of malware disguises itself as a legitimate program? A) Worm B) Trojan horse C) Virus D) Spyware Answer: B Explanation: Trojans appear benign but contain hidden malicious functionality. Question 11. Ergonomic keyboards help prevent which occupational injury? A) Carpal Tunnel Syndrome B) Tendonitis of the shoulder C) Lower back strain D) Eye fatigue Answer: A Explanation: Ergonomic keyboards reduce wrist strain, a major factor in carpal tunnel syndrome.

Exam

Question 12. In requirements analysis, a functional requirement describes: A) System performance metrics B) User interface colors C) What the system shall do D) Legal compliance constraints Answer: C Explanation: Functional requirements specify behaviors, tasks, or functions the system must perform. Question 13. Which flowchart symbol represents a decision point? A) Rectangle B) Diamond C) Parallelogram D) Oval Answer: B Explanation: A diamond indicates a branch based on a true/false condition. Question 14. In a Level‑0 Data Flow Diagram, the external entity is shown as: A) A circle B) A rectangle C) A double‑line rectangle D) An arrow Answer: B

Exam

Answer: C Explanation: Floating‑point types represent numbers with fractional parts. Question 18. Normalizing a relational database primarily aims to: A) Increase file size B) Reduce data redundancy C) Speed up CPU processing D) Simplify user interface design Answer: B Explanation: Normalization organizes data to eliminate duplicate information. Question 19. Peer code reviews are most effective when they focus on: A) Personal coding style preferences B) Functional correctness, readability, and adherence to standards C) The programmer’s salary D) The IDE’s color scheme Answer: B Explanation: Reviews should assess correctness, clarity, and compliance with coding standards. Question 20. Assembly language is classified as a: A) High‑level language B) Fourth‑generation language C) Low‑level language

Exam

D) Scripting language Answer: C Explanation: Assembly provides a mnemonic representation of machine instructions, close to hardware. Question 21. Which control structure repeats a block of code a known number of times? A) If‑else B) Switch C) For loop D) While loop Answer: C Explanation: A for loop iterates a set number of times, often using a counter. Question 22. An array that stores a table of 5 rows and 3 columns is an example of: A) One‑dimensional array B) Two‑dimensional array C) Linked list D) Stack Answer: B Explanation: Multi‑dimensional arrays represent data in rows and columns. Question 23. Which data structure follows a “last‑in, first‑out” (LIFO) order? A) Queue B) Stack

Exam

A) // comment B) /* comment */ C) # comment D) Answer: C Explanation: Python uses the hash symbol for single‑line comments. Question 27. A syntax error will be detected at which stage? A) Design B) Compilation (or interpretation) C) Runtime D) Maintenance Answer: B Explanation: Syntax errors violate language rules and are caught when code is compiled or interpreted. Question 28. Division by zero in most languages generates a: A) Syntax error B) Logic error C) Runtime error (exception) D) Compilation warning Answer: C Explanation: The error occurs during execution, causing an exception or crash.

Exam

Question 29. Unit testing focuses on: A) Entire system integration B) Individual components or functions in isolation C) User acceptance criteria D) Performance under load Answer: B Explanation: Unit tests verify that each smallest testable part works correctly. Question 30. A breakpoint in a debugger is used to: A) Automatically fix bugs B) Pause program execution at a specific line C) Compile the program faster D) Generate documentation Answer: B Explanation: Breakpoints halt execution, allowing inspection of state. Question 31. Version control systems like Git help with: A) Automatic code generation B) Tracking changes and collaborating on source code C) Compressing executable files D) Encrypting network traffic Answer: B Explanation: Git records revisions, enabling rollback and teamwork.

Exam

Explanation: Flat files contain records separated by delimiters without relational links. Question 35. The principle of “least privilege” in security means: A) Users should have admin rights at all times B) Users receive only the permissions needed to perform their tasks C) All files are read‑only D) Passwords are shared among team members Answer: B Explanation: Limiting privileges reduces the impact of compromised accounts. Question 36. Which of the following is a characteristic of a well‑named variable? A) Single character “x” B) Abbreviation without documentation C) Descriptive, meaningful, and uses consistent casing D) All uppercase letters only Answer: C Explanation: Clear naming improves readability and maintenance. Question 37. The CAN‑SPAM Act regulates: A) Software licensing agreements B) Commercial email messages C) Encryption key export D) Online gambling

Exam

Answer: B Explanation: CAN‑SPAM sets rules for commercial email, including opt‑out mechanisms. Question 38. A “trojan” typically requires which of the following to infect a system? A) Network worm propagation B) User execution of a seemingly legitimate program C) Automatic execution on boot D) Direct hardware manipulation Answer: B Explanation: Trojans rely on users launching the disguised program. Question 39. In a relational database, a primary key is used to: A) Store large binary objects B) Uniquely identify each record in a table C) Encrypt the table data D) Define the table’s visual layout Answer: B Explanation: Primary keys enforce uniqueness and enable relationships. Question 40. Which of the following is NOT a typical phase of the SDLC? A) Analysis B) Prototyping C) Implementation

Exam

B) A recursive function lacks a proper base case C) A file cannot be opened D) A syntax error is present Answer: B Explanation: Unbounded recursion consumes stack frames until overflow. Question 44. In C++, the scope resolution operator (::) is used to: A) Access members of a namespace or class B) Define a pointer C) Perform integer division D) Include a header file Answer: A Explanation: :: qualifies names with their enclosing scope. Question 45. Which of the following best describes “encapsulation” in OOP? A) Inheriting behavior from a parent class B) Hiding internal data and exposing only necessary methods C) Overloading operators D) Defining multiple constructors Answer: B Explanation: Encapsulation protects object state by restricting direct access. Question 46. A “hash table” provides average‑case lookup time of:

Exam

A) O(n) B) O(log n) C) O(1) D) O(n log n) Answer: C Explanation: Properly designed hash tables achieve constant‑time average lookups. Question 47. Which HTTP status code indicates that the client must authenticate to gain network access? A) 200 OK B) 301 Moved Permanently C) 401 Unauthorized D) 500 Internal Server Error Answer: C Explanation: 401 signals that authentication is required. Question 48. In relational algebra, the operation that selects rows meeting a condition is called: A) Projection B) Selection C) Join D) Union Answer: B Explanation: Selection (σ) filters tuples based on a predicate.

Exam

Explanation: Queues process elements in the order they arrive. Question 52. In Python, which keyword is used to handle exceptions? A) try / except B) catch / finally C) error / handle D) throw / catch Answer: A Explanation: Python uses try and except blocks to catch and manage exceptions. Question 53. Which of the following is a characteristic of a “static” method in Java? A) It can access instance variables directly B) It belongs to the class, not to any object instance C) It must be overridden in subclasses D) It can be called only after creating an object Answer: B Explanation: Static methods are invoked on the class itself. Question 54. The Big O notation O(n²) describes an algorithm whose running time grows proportionally to: A) The square of the input size B) The logarithm of the input size C) The input size multiplied by a constant

Exam

D) The factorial of the input size Answer: A Explanation: O(n²) indicates quadratic growth as input size increases. Question 55. Which of the following best describes “refactoring”? A) Adding new features without testing B) Changing code structure to improve readability without altering behavior C) Converting code to a different programming language D) Removing all comments from source files Answer: B Explanation: Refactoring optimizes internal code quality while preserving external functionality. Question 56. Which of these is a valid reason to use a “switch” statement over multiple “if‑else” blocks? A) The condition involves ranges of values B) The variable being tested is a boolean C) You have many discrete constant cases to evaluate D) You need to execute code before evaluating the condition Answer: C Explanation: Switch statements efficiently handle numerous distinct constant cases. Question 57. In a relational database, “referential integrity” ensures that: A) All tables have the same number of columns