πŸ“š Computer β€” Computer

Operators, Control Structures, Functions, Arrays, and Program Errors (Programming 2)

Comprehensive study material on types of programming languages, high-level and low-level classification, object-oriented concepts, and software testing

One-Liner Questions

Into how many primary categories are programming languages broadly classified?
Primarily into Low-Level Languages and High-Level Languages.
Tap to view answer
Under which category is Machine Language placed?
It is a first-generation low-level language understood directly by hardware.
Tap to view answer
What is the key feature of Assembly Language?
It uses short mnemonics (such as ADD, SUB) in place of raw machine code.
Tap to view answer
What are Third Generation Languages (3GL) based on?
They are procedural high-level languages such as C and Pascal.
Tap to view answer
What is the main objective of Fourth Generation Languages (4GL)?
To simplify programming and facilitate database management and querying (such as SQL).
Tap to view answer
What are Fifth Generation Languages (5GL) associated with?
Artificial Intelligence (AI) and Natural Language Processing (NLP).
Tap to view answer
What is the core principle of Object-Oriented Programming (OOP)?
It bundles data and its associated functions together into 'objects'.
Tap to view answer
How is a Class defined in OOP?
It serves as a blueprint or template for creating objects.
Tap to view answer
What is an Object?
It is a real-world instance of a class that possesses attributes and methods.
Tap to view answer
What does Inheritance mean?
The mechanism by which a new class automatically acquires the properties and methods of an existing (base) class.
Tap to view answer
What does Polymorphism mean in programming?
The ability of the same name or function to exhibit different forms or behaviors in different contexts.
Tap to view answer
What protection does Encapsulation provide?
It binds data and methods into a single unit and restricts unauthorized external access.
Tap to view answer
What is the primary benefit of Abstraction?
Hiding complex internal implementation details and exposing only essential functionality.
Tap to view answer
What is the first phase of the Software Development Life Cycle (SDLC)?
Problem identification and Requirement Analysis.
Tap to view answer
Why is Software Testing necessary?
To detect bugs and defects in a program and ensure its quality.
Tap to view answer
When is a Syntax Error detected?
During program compilation.
Tap to view answer
How is a Logical Error identified?
When the program produces incorrect or unexpected output.
Tap to view answer
When does a Run-time Error occur?
When an illegal operation (such as division by zero) is attempted during program execution.
Tap to view answer
What is the main task of Debugging?
Finding and fixing errors (bugs) in a program.
Tap to view answer
What is White-box Testing based on?
Complete knowledge of the program's internal structure, source code, and logic paths.
Tap to view answer
What is verified in Black-box Testing?
The accuracy of input and output behavior without examining the internal code.
Tap to view answer
Who typically performs Unit Testing?
Usually the software developer, testing an individual small component or function.
Tap to view answer
What is the objective of Integration Testing?
To verify the combined behavior of multiple modules after they are connected together.
Tap to view answer
What does System Testing verify?
That the entire software system complies with its business and technical requirements.
Tap to view answer
Where is Alpha Testing conducted?
In the development environment by the in-house team before product release.
Tap to view answer
Who conducts Beta Testing?
Real end-users in their own operating environments.
Tap to view answer
What are prominent examples of Procedural Programming languages?
C, Fortran, and COBOL.
Tap to view answer
What are well-known examples of Object-Oriented languages?
C++, Java, and C#.
Tap to view answer
What is the key feature of a Scripting Language?
They generally do not require prior compilation and are interpreted at runtime (such as Python, JavaScript).
Tap to view answer
What is the biggest limitation of Machine Language?
It is machine-dependent and can only run on a specific processor architecture.
Tap to view answer
What translates Assembly Language into Machine Language?
An Assembler.
Tap to view answer
Which tools are used to translate High-Level Languages?
Compilers and Interpreters.
Tap to view answer
What does 'Portability' mean for High-Level Languages?
The ability to run code written on one computer on another computer with little or no modification.
Tap to view answer
What does Structured Programming emphasize?
Avoiding 'goto' statements and writing clean, modular code.
Tap to view answer
What is the advantage of using Functions or Procedures in programming?
Increasing code reusability and reducing complexity.
Tap to view answer
What is the characteristic of a Global Variable?
It can be accessed from anywhere within the entire program.
Tap to view answer
Where is a Local Variable valid?
Only within the specific function or block in which it is declared.
Tap to view answer
What is the primary risk in Recursion?
Without a proper base condition, it can cause a Stack Overflow.
Tap to view answer
What is the limitation of an Array?
It has a fixed size and cannot be easily resized at runtime.
Tap to view answer
What is the primary use of a Pointer?
Direct management of memory addresses and Dynamic Memory Allocation.
Tap to view answer
What is the difference between Malware and a Software Bug?
A bug is an unintentional programming mistake, whereas malware is intentionally created malicious software.
Tap to view answer
What is the objective of Code Optimization?
To reduce a program's execution time and memory consumption.
Tap to view answer
What is the use of a Version Control System in software development?
To save code history and enable multiple developers to collaborate effectively.
Tap to view answer
When is Regression Testing performed?
After making a code change or bug fix, to ensure existing functionality has not been broken.
Tap to view answer
What is Sanity Testing?
A quick check after minor changes to verify that the specific affected feature works properly.
Tap to view answer
At what stage is Smoke Testing performed?
As an initial check on a new build to verify its basic stability.
Tap to view answer
What are the two main types of Polymorphism?
Compile-time polymorphism (function overloading) and Run-time polymorphism (function overriding).
Tap to view answer
What does Multiple Inheritance mean?
When a single child class inherits properties from more than one parent class.
Tap to view answer
What role does an Interface play in C++ or Java?
It acts as a completely abstract type that only declares method signatures.
Tap to view answer
What is the main function of a Constructor?
To initialize an object's data members when the object is created.
Tap to view answer
What does a Destructor do?
It releases the memory occupied by an object when the object is destroyed.
Tap to view answer
What is Operator Overloading?
Giving an existing operator a new meaning for user-defined data types.
Tap to view answer
What is Dynamic Binding related to?
Determining at runtime which method implementation will be executed.
Tap to view answer
When does Static Binding occur?
When the method call is resolved at compile time.
Tap to view answer
What is the use of an Abstract Class?
A class that cannot be instantiated directly and serves solely as a base class.
Tap to view answer
What does Metadata mean in programming?
Data about data, which defines its structure and attributes.
Tap to view answer
What are ACID properties associated with?
The reliability and integrity of database transactions.
Tap to view answer
What is another name for Parametric Polymorphism?
Generic Programming (Generics).
Tap to view answer
Why is Operator Precedence important in calculations?
It determines the order in which operators are evaluated in an expression.
Tap to view answer
What is Short-circuit Evaluation?
Skipping the evaluation of the remaining part of a logical expression once the final result is already determined.
Tap to view answer
What is the function of a File Pointer?
To track the current read or write position within a file.
Tap to view answer
What is the main difference between a Binary File and a Text File?
A text file stores data as standardized characters, whereas a binary file stores raw bytes directly.
Tap to view answer
What is the main objective of Exception Handling?
To manage runtime errors gracefully so that the program does not crash unexpectedly.
Tap to view answer
What are 'try' and 'catch' blocks used for?
Placing error-prone code inside the 'try' block and handling any thrown errors in the 'catch' block.
Tap to view answer
What is a Thread in the context of operating systems and programming?
The smallest unit of execution within a process.
Tap to view answer
What is the advantage of Multithreading?
Maximizing processor utilization by executing multiple tasks concurrently.
Tap to view answer
What is a Race Condition?
When two or more processes or threads access shared data simultaneously, making the outcome unpredictable.
Tap to view answer
Where are Mutexes and Semaphores used?
In thread synchronization and controlling access to mutually exclusive resources.
Tap to view answer
What is a Buffer Overflow from a security perspective?
A serious vulnerability where writing data beyond a buffer's capacity compromises system stability or security.
Tap to view answer
What is the function of Garbage Collection?
Automatically reclaiming memory occupied by unused objects that are no longer needed.
Tap to view answer
What characterizes Static Typing?
Variable data types are determined and checked at compile time.
Tap to view answer
Where is Dynamic Typing found?
In languages like Python, where data types are determined at runtime.
Tap to view answer
What is a Pure Virtual Function?
A virtual function with no body that must be defined by any derived class.
Tap to view answer
What does a Friend Function do in C++?
It allows access to the private members of a class even though it is not a member of that class.
Tap to view answer
What is the advantage of an Inline Function?
Increasing execution speed for small functions by eliminating function-call overhead.
Tap to view answer
What is the difference between a Macro and a Function?
A macro operates via text substitution by the preprocessor, whereas a function is an actual executable code unit.
Tap to view answer
What is the function of a Preprocessor Directive?
To include other files or configure settings in the code before compilation begins.
Tap to view answer
What does Refactoring mean in software development?
Improving the internal structure and readability of code without altering its external behavior.
Tap to view answer
What is the core feature of the Agile software development methodology?
Developing software in short iterative cycles while prioritizing continuous customer feedback.
Tap to view answer
What is the nature of the Waterfall Model?
It is a linear and sequential software development model.
Tap to view answer
What is Grey-box Testing?
Testing conducted with partial knowledge of the internal structure of the application.
Tap to view answer
What is the objective of Load Testing?
To evaluate system performance and stability under expected user load.
Tap to view answer
When is Stress Testing performed?
When subjecting a system to loads beyond its normal capacity to observe its breaking point.
Tap to view answer
What is Penetration Testing related to?
Authorized simulated cyberattacks conducted to identify security vulnerabilities in a system.
Tap to view answer
What does the Code Coverage metric measure?
The percentage of source code executed during testing.
Tap to view answer
What is Mutation Testing?
Introducing small changes (mutations) into code to evaluate the quality and effectiveness of a test suite.
Tap to view answer
Where is the Boundary Value Analysis technique used?
In black-box testing to detect errors at the extreme edges of input ranges.
Tap to view answer
What is Equivalence Partitioning?
Dividing input data into equivalent classes and testing one representative value from each class.
Tap to view answer
What is the ultimate goal of User Acceptance Testing (UAT)?
To confirm that the software meets business requirements and user expectations.
Tap to view answer
What is Pilot Implementation?
Testing software with a small group of users before full-scale deployment.
Tap to view answer
What does the 'Closed' status mean in the Bug Life Cycle?
The bug has been fixed and its resolution has been verified through testing.
Tap to view answer
What is the primary output of System Analysis?
Preparing the Software Requirements Specification (SRS) document.
Tap to view answer
What is the use of a Data Dictionary?
A centralized repository defining all data elements, their meanings, and formats used in a system.
Tap to view answer
Why is Modularity important in programming?
To divide large programs into smaller, independent, and manageable components.
Tap to view answer
What is Spaghetti Code?
Poorly structured code with tangled and complex control flow.
Tap to view answer
What is the key difference between Data Abstraction and Data Encapsulation?
Abstraction hides 'what' is done (complexity), whereas Encapsulation protects 'how' it is stored by bundling data and code together.
Tap to view answer
What is the literal meaning of 'Polymorphism' in programming?
Taking Many Forms.
Tap to view answer
What are Machine Language and Assembly Language collectively called?
Low-Level Languages.
Tap to view answer
What is the primary human-centric advantage of High-Level Languages?
They are very close to natural English, making them easy to learn, read, and remember.
Tap to view answer
Quick Reference
Key Facts & Contributions
Programming 2
Language / ConceptKey CharacteristicPrimary Use
Machine LanguageUses only binary digits (0 and 1); machine-dependentDirect hardware control and lowest-level instructions
Assembly LanguageUses mnemonics; processor-specificSystem software and microcontroller programming
High-Level LanguageHuman-readable English-like words; portable and machine-independentGeneral-purpose software, web, and app development
Object-Oriented Programming (OOP)Uses classes, objects, inheritance, and polymorphismComplex software architecture and large-scale projects
White-box TestingBased on full knowledge of internal source code and logic pathsUnit testing and verification of code structure
Black-box TestingTests only input-output behavior without viewing internal codeSystem, integration, and user acceptance testing
CompilerConverts entire source code into machine code all at onceTranslation of C, C++, and other compiled languages
InterpreterReads and executes source code line by lineExecution of scripting languages such as Python
No matching content found.