






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























1. What is the primary purpose of a programming language?
A. To provide instructions a computer can execute B. To replace computer hardware C. To store hardware components D. To create network cables
Correct Answer: A
Rationale: Programming languages allow developers to communicate algorithms and instructions to computers.
2. Which category includes languages such as C, Java, and Python?
A. High-level languages B. Machine languages C. Binary languages D. Firmware languages
Correct Answer: A
Rationale: High-level languages are designed to be easier for humans to read and write.
3. Machine language consists of:
A. Binary instructions B. English statements C. Mathematical formulas only D. Database commands only
Correct Answer: A
Rationale: Computers directly execute binary machine instructions.
4. What is the role of a compiler?
A. Translate source code into machine code before execution B. Execute code one line at a time C. Design databases D. Create user interfaces
Correct Answer: A
Rationale: Compilers generate executable code from source programs.
5. An interpreter differs from a compiler because it:
A. Executes code line by line B. Produces machine code files first C. Eliminates syntax errors automatically D. Creates hardware instructions directly
Correct Answer: A
Rationale: Interpreters translate and execute code incrementally during runtime.
6. Which language is commonly interpreted?
A. Python B. C++ C. Assembly D. COBOL
Correct Answer: A
Rationale: Python programs are typically executed through an interpreter.
7. Which language is commonly compiled?
A. C++ B. Python
A. A named storage location for data B. A compiler feature C. A network device D. A database table
Correct Answer: A
Rationale: Variables store values used by programs.
12. Which data type stores whole numbers?
A. Integer B. Float C. String D. Boolean
Correct Answer: A
Rationale: Integers represent numbers without decimal points.
13. Which data type stores decimal values?
A. Float B. Integer C. String D. Character
Correct Answer: A
Rationale: Floating-point variables store fractional values.
14. A Boolean variable stores:
A. True or False B. Text only C. Decimal values only D. Whole numbers only
Correct Answer: A
Rationale: Boolean values represent logical states.
15. What is a string?
A. A sequence of characters B. A mathematical operator C. A hardware device D. A database query
Correct Answer: A
Rationale: Strings store text information.
16. Which operator is typically used for assignment?
A. = B. == C. != D. <=
Correct Answer: A
Rationale: Assignment operators store values in variables.
17. Which operator checks equality?
A. == B. = C. += D. /=
Correct Answer: A
Rationale: Equality operators compare values rather than assign them.
18. Conditional statements allow a program to:
A. Make decisions B. Create hardware C. Compile automatically D. Eliminate variables
Correct Answer: A
Rationale: Conditions control program flow based on logic.
Rationale: For loops efficiently handle predictable repetition.
23. A while loop executes until:
A. Its condition becomes false B. The program ends C. A variable is declared D. A file is saved
Correct Answer: A
Rationale: While loops depend on a logical condition.
24. What is a function?
A. A reusable block of code B. A database field C. A hardware component D. A compiler module
Correct Answer: A
Rationale: Functions help organize and reuse logic.
25. What is the main benefit of functions?
A. Modularity and code reuse B. Elimination of variables C. Removal of testing D. Faster hardware performance
Correct Answer: A
Rationale: Functions reduce duplication and improve maintainability.
26. A parameter is:
A. Input provided to a function B. A compiler warning C. A loop structure D. A database record
Correct Answer: A
Rationale: Parameters allow functions to receive data.
27. What does a return statement do?
A. Sends a value back from a function B. Stops the operating system C. Deletes variables D. Creates an object
Correct Answer: A
Rationale: Return statements provide results from function execution.
28. What is recursion?
A. A function calling itself B. A type of compiler C. A database process D. A network operation
Correct Answer: A
Rationale: Recursion solves problems through repeated self-reference.
29. What is object-oriented programming (OOP)?
A. A paradigm based on classes and objects B. A hardware design method C. A networking protocol D. A database architecture
Correct Answer: A
Rationale: OOP organizes software around reusable objects.
30. A class is:
A. A blueprint for creating objects B. A database table
A. Different behaviors through a common interface B. Hardware optimization C. Database replication D. Memory allocation
Correct Answer: A
Rationale: Polymorphism increases software flexibility.
35. Abstraction focuses on:
A. Hiding implementation details B. Eliminating objects C. Removing methods D. Increasing complexity
Correct Answer: A
Rationale: Abstraction simplifies interactions with complex systems.
36. Which language is strongly associated with object-oriented programming?
A. Java B. Assembly C. Binary D. Machine Code
Correct Answer: A
Rationale: Java was designed with object-oriented principles at its core.
37. What is a programming paradigm?
A. A style or methodology of programming B. A hardware component C. A database engine D. A compiler feature
Correct Answer: A
Rationale: Paradigms provide approaches to software design and development.
38. Procedural programming focuses on:
A. Procedures and functions B. Objects and classes C. Hardware design D. Network communication
Correct Answer: A
Rationale: Procedural programming emphasizes sequential instructions and procedures.
39. Functional programming emphasizes:
A. Pure functions and immutability B. Hardware optimization C. Database management D. Operating systems
Correct Answer: A
Rationale: Functional programming treats computation as function evaluation.
40. Which language is commonly associated with functional programming?
A. Haskell B. COBOL C. Assembly D. BASIC
Correct Answer: A
Rationale: Haskell is a prominent functional programming language.
41. What is strong typing?
A. Strict enforcement of data type rules B. Fast keyboard usage C. High processor speed D. Large memory capacity
Correct Answer: A
Rationale: Strong typing helps prevent invalid operations on data.
Rationale: JVM technology enables Java applications to run on different systems.
46. What is source code?
A. Human-readable program instructions B. Machine code only C. Binary output D. Database information
Correct Answer: A
Rationale: Developers write source code before it is translated into executable form.
47. What is debugging?
A. Finding and correcting software defects B. Creating databases C. Writing documentation only D. Installing operating systems
Correct Answer: A
Rationale: Debugging improves software correctness and reliability.
48. Software testing is performed to:
A. Verify functionality and identify defects B. Replace programming languages C. Eliminate documentation D. Avoid maintenance
Correct Answer: A
Rationale: Testing ensures applications meet requirements and perform correctly.
49. Why is readability important in programming languages?
A. Easier maintenance and collaboration B. Faster hardware execution C. Reduced memory usage automatically D. Elimination of bugs completely
Correct Answer: A
Rationale: Readable code is easier to understand, modify, and support.
50. The ultimate purpose of programming languages is to:
A. Solve computational and real-world problems through software B. Replace hardware entirely C. Eliminate operating systems D. Prevent future software maintenance
Correct Answer: A
Rationale: Programming languages provide the tools needed to create useful software solutions.
51. What is a data structure?
A. A method of organizing and storing data efficiently B. A compiler component C. A network protocol D. A software license
Correct Answer: A
Rationale: Data structures improve the efficiency of data storage and retrieval.
52. Which data structure stores elements in indexed positions?
A. Array B. Stack C. Queue D. Dictionary
Correct Answer: A
Rationale: Arrays allow direct access to elements using indexes.
53. A stack follows which principle?
A. Last In, First Out (LIFO) B. First In, First Out (FIFO) C. Random Access D. Sequential Access Only
C. Increase processor speed D. Create variables
Correct Answer: A
Rationale: Garbage collection prevents memory leaks by freeing unused resources.
58. Which language commonly uses automatic garbage collection?
A. Java B. Assembly C. C D. Pascal
Correct Answer: A
Rationale: Java automatically manages memory through garbage collection.
59. What is a memory leak?
A. Memory that is allocated but not properly released B. A syntax error C. A network outage D. A compiler warning
Correct Answer: A
Rationale: Memory leaks can cause performance degradation and crashes.
60. What is concurrency?
A. Executing multiple tasks during overlapping time periods B. Executing only one task at a time C. Eliminating variables D. Managing databases
Correct Answer: A
Rationale: Concurrency improves responsiveness and efficiency.
61. A thread is:
A. A lightweight unit of execution within a process B. A database record C. A compiler directive D. A hardware device
Correct Answer: A
Rationale: Threads allow multiple operations to execute concurrently.
62. Synchronization is used to:
A. Coordinate access to shared resources B. Compile programs C. Design interfaces D. Create variables
Correct Answer: A
Rationale: Synchronization prevents data corruption in concurrent environments.
63. A race condition occurs when:
A. Multiple threads access shared data unpredictably B. A program compiles successfully C. Memory is allocated correctly D. Hardware operates normally
Correct Answer: A
Rationale: Race conditions can lead to inconsistent outcomes.
64. What is exception handling?
A. Managing runtime errors gracefully B. Creating classes C. Compiling software D. Managing databases
Correct Answer: A
Rationale: Exception handling improves reliability and user experience.
69. Modular programming involves:
A. Dividing software into smaller manageable components B. Writing all code in a single file C. Eliminating functions D. Avoiding testing
Correct Answer: A
Rationale: Modularity improves organization and maintainability.
70. What is software portability?
A. Ability to run on different platforms with minimal modification B. Ability to eliminate bugs C. Ability to increase memory size D. Ability to create databases
Correct Answer: A
Rationale: Portable software is easier to deploy across systems.
71. Why are meaningful variable names important?
A. They improve readability and maintenance B. They increase processor speed C. They reduce memory requirements D. They eliminate errors completely
Correct Answer: A
Rationale: Clear naming helps developers understand code.
72. What is maintainability?
A. Ease of modifying and updating software B. Execution speed only C. Memory capacity only D. Number of users supported
Correct Answer: A
Rationale: Maintainable software is easier to improve and support.
73. Refactoring involves:
A. Improving code structure without changing behavior B. Replacing hardware C. Deleting documentation D. Creating new programming languages
Correct Answer: A
Rationale: Refactoring enhances quality and maintainability.
74. Documentation helps by:
A. Explaining software design and usage B. Replacing source code C. Eliminating testing D. Increasing processor speed
Correct Answer: A
Rationale: Documentation supports developers and users.
75. Internal documentation often consists of:
A. Comments within source code B. Marketing brochures C. User manuals only D. Hardware diagrams only
Correct Answer: A
Rationale: Comments explain logic and implementation details.
76. Why is software testing necessary?
A. To identify defects and verify requirements B. To replace programming languages C. To eliminate source code D. To avoid maintenance