0% found this document useful (0 votes)
9 views

Unit 4 Question Bank.doc

The document is a question bank for an Advanced Software Engineering course, focusing on software implementation topics. It includes multiple-choice questions, short answer questions, and essay prompts related to structured coding techniques, coding standards, documentation practices, type checking, exception handling, and concurrency. The content emphasizes the importance of readability, maintainability, and effective coding practices in software development.

Uploaded by

mallesrihari69
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Unit 4 Question Bank.doc

The document is a question bank for an Advanced Software Engineering course, focusing on software implementation topics. It includes multiple-choice questions, short answer questions, and essay prompts related to structured coding techniques, coding standards, documentation practices, type checking, exception handling, and concurrency. The content emphasizes the importance of readability, maintainability, and effective coding practices in software development.

Uploaded by

mallesrihari69
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

ADVANCED SOFTWARE ENGINEERING

UNIT-IV QUESTION BANK

SOFTWARE IMPLEMENTATION
PART – A (One mark questions)

1.What is the main benefit of structured coding techniques?

A) Faster execution
B) Easier debugging and maintenance
C) Increased memory usage
D) More complex code
Answer: B) Easier debugging and maintenance

2.Which of the following is NOT typically part of coding style guidelines?

A) Indentation
B) Variable naming
C) Memory allocation
D) Commenting practices

Answer: C) Memory allocation


3.Why are coding standards important in a team environment?

A) To enforce faster code writing


B) To make code more complex
C) To ensure code consistency and readability
D) To make debugging harder
Answer: C) To ensure code consistency and readability

4.What is the main purpose of code documentation?

A) To improve code execution speed


B) To assist other developers in understanding the code
C) To make the code more complex
D) To reduce the need for testing

Answer: B) To assist other developers in understanding the code


5.What does type checking ensure in programming languages?

A) Variables are assigned values of the correct data type


B) Variables are assigned random values
C) Functions return no values
D) Memory is automatically managed

Answer: A) Variables are assigned values of the correct data type


6.Which of the following is a user-defined data type in C?

A) int
B) float
C) struct
D) double Answer: C) struct
7. Data abstraction is used to:

A) Hide the complexity of data


B) Show all the details of a data structure
C) Increase the execution time of code
D) Directly modify memory

Answer: A) Hide the complexity of data


8.What does exception handling provide in programming?

A) A method to ignore all errors


B) A way to deal with runtime errors safely
C) Automatic performance optimization
D) A way to compile code faster

Answer: B) A way to deal with runtime errors safely


9.What is concurrency in programming?

A) Writing code that is executed sequentially


B) Executing multiple tasks at the same time
C) Only executing one task at a time
D) Running code faster by skipping checks

Answer: B) Executing multiple tasks at the same time


10.Which of the following is a characteristic of structured programming?

a) Goto statements
b) Modular design
c) Global variables
d) Infinite loops

Answer: b) Modular design


11.Which is the primary goal of structured programming?

a) To use as many functions as possible


b) To improve code readability and maintainability
c) To increase the number of conditional branches
d) To minimize comments in the code

Answer: b) To improve code readability and maintainability

12.What is the purpose of using a consistent coding style?

a) To increase code complexity


b) To make the code run faster
c) To improve readability and reduce errors
d) To use more lines of code

Answer: c) To improve readability and reduce errors

13.Which of the following is NOT a recommended practice for good coding style?

a) Proper indentation
b) Descriptive variable names
c) Global variables everywhere
d) Modular design

Answer: c) Global variables everywhere

14.What does "DRY" stand for in coding style?

a) Don’t Repeat Yourself


b) Don’t Run Yield
c) Dynamic Runtime Yield
d) Debug and Run Yourself

Answer: a) Don’t Repeat Yourself

15. Which of the following is a widely accepted coding standard for C programming?

a) PSR-12
b) PEP 8
c) MISRA C
d) None of the above

Answer: c) MISRA C
16. Why are coding standards important?

a) They enforce the use of only one programming language.


b) They ensure consistency, readability, and maintainability.
c) They allow each programmer to have their own style.
d) They make the code run faster.

Answer: b) They ensure consistency, readability, and maintainability.

17. What is the primary purpose of documentation in programming?

a) To describe how to install the programming environment


b) To provide clear and concise explanations of the code
c) To store version history
d) To create diagrams for the code

Answer: b) To provide clear and concise explanations of the code

18. Inline comments in code should be used:

a) After every line of code


b) Sparingly, only when the logic isn't immediately clear
c) To describe every variable
d) To repeat what the code is doing

Answer: b) Sparingly, only when the logic isn't immediately clear


19. Which of the following is an example of good documentation practice?

a) Using auto-generated comments without any edits


b) Writing documentation after project completion
c) Providing an overview of each function's purpose
d) Not writing comments if the code is self-explanatory

Answer: c) Providing an overview of each function's purpose

20. What does type checking in a programming language ensure?

a) That variables are strongly typed


b) That errors in types are found during execution
c) That operations are only performed on compatible data types
d) That all data types are converted to strings

Answer: c) That operations are only performed on compatible data types


21. Which of the following programming languages supports strong type checking?

a) Python
b) C
c) Java
d) JavaScript
Answer: c) Java
22. A user-defined data type is:

a) A primitive type like int or char


b) Defined by the programmer, such as a class or structure
c) Automatically defined by the compiler
d) A type that changes during runtime

Answer: b) Defined by the programmer, such as a class or structure


23. What does data abstraction focus on?

a) How data is stored in memory


b) Hiding implementation details from the user
c) Showing all details to the user
d) Writing complex algorithms

Answer: b) Hiding implementation details from the user


24. Which of the following keywords is used in most programming languages to handle
exceptions?

a) try-catch
b) if-else
c) switch-case
d) break-continue

Answer: a) try-catch

25. What is the main purpose of exception handling in programming?

a) To terminate the program immediately on an error


b) To gracefully manage runtime errors without crashing the program
c) To convert errors into warnings
d) To catch all syntax errors

Answer: b) To gracefully manage runtime errors without crashing the program


PART - B – TWO MARKS

1.​ What is the importance of modularity in structured coding techniques?

Answer: Modularity breaks down a program into smaller, manageable, and independent
modules or functions. It enhances code readability, maintainability, and reusability while
simplifying debugging and testing.

2.​ How does control flow impact structured programming?

Control flow ensures the logical sequence of instructions through structures like
selection (if-else), iteration (loops), and sequence (function calls). It minimizes the use of
GOTO statements and promotes cleaner, more understandable code.

3.Why is proper indentation crucial in coding style?

Proper indentation enhances code readability by visually organizing code into logical blocks. It
makes the structure and flow of the code easier to understand, especially when using loops,
conditionals, and functions.

4.​ What is the significance of naming conventions in coding?


Naming conventions provide consistency in code by ensuring variables, functions, and classes are
descriptively and logically named. This aids in improving code readability and makes the code
easier to maintain and debug by others.

5.​ What are the benefits of adhering to coding standards?


Coding standards ensure uniformity and consistency across a codebase, improving collaboration
among developers. They also enhance maintainability, readability, error prevention, and
the ease of onboarding new developers into a project.

6.​ What is MISRA C, and why is it important?


MISRA C is a set of software development guidelines for the C programming language, aimed at
enhancing code safety, portability, and reliability in embedded systems. It is widely used in
industries like automotive for safety-critical applications.

7.​ How does inline commenting improve code documentation?


Inline commenting clarifies specific sections of code by providing explanations of complex logic
or uncommon coding patterns. This helps future developers understand the code without needing
to reverse-engineer its functionality.

8.​ What are the key components of good API documentation?

Good API documentation includes clear explanations of each function's purpose, its input
and output parameters, possible exceptions, return values, and examples of use. This
facilitates effective API integration and reduces development errors.

9.​ Classify static vs. dynamic type checking.

Static type checking occurs at compile-time, ensuring that variables are assigned
compatible types before the code is executed (e.g., in C, Java). Dynamic type checking
occurs at runtime, allowing more flexibility in type assignment (e.g., in Python,
JavaScript).

10.​ How do modern programming languages implement strong typing?


Strong typing ensures that variables are strictly associated with data types and that
operations on mismatched types are disallowed. For example, languages like Java and C#
enforce strong typing, preventing unintended type casting and runtime errors.

11.​ What are user-defined data types, and why are they useful?
User-defined data types, like classes and structures, allow programmers to define custom types that
group related data under a single name. This improves code clarity, enforces logical grouping of
data, and enhances data management in complex programs.

12.​What is an example of a user-defined data type in C++?


In C++, a class is a user-defined data type. It allows for the encapsulation of data and functions
that operate on that data, enabling object-oriented programming and data abstraction.

13.​ Define data abstraction and its significance in object-oriented programming.

Data abstraction involves exposing only essential information to the user while hiding
implementation details. This simplifies program complexity and promotes modularity,
making code easier to maintain and extend. It's a key principle in OOP.

14.​How does encapsulation support data abstraction?

Encapsulation supports data abstraction by bundling data (attributes) and the methods that
manipulate them into a single unit (class) and restricting direct access to some
components. This ensures a controlled interface for interacting with the object.

15.​ What are the advantages of using exception handling in a program?

Exception handling allows a program to respond to runtime errors gracefully without crashing. It
helps isolate error-handling code from regular logic, promoting cleaner code, improving
debugging, and ensuring application stability.

16.​Explain the difference between checked and unchecked exceptions in Java.

Checked exceptions are errors that are checked at compile-time (e.g., IOException), and
the programmer must handle them explicitly. Unchecked exceptions occur at runtime
(e.g., NullPointerException) and do not require explicit handling but can be caught if
needed.

17.​What is concurrency, and why is it important in modern software development?

Concurrency allows multiple tasks to be executed simultaneously or in overlapping periods. It


improves resource utilization, responsiveness, and throughput, especially in systems requiring
multitasking or parallel processing.

18.​Describe the purpose of thread synchronization in concurrent programming.


Thread synchronization ensures that multiple threads can access shared resources safely without
causing data inconsistency or race conditions. It prevents issues like deadlocks and ensures that
operations on shared data are completed atomically.

19.​What is a deadlock in concurrency, and how can it be avoided?


A deadlock occurs when two or more threads are waiting on each other to release resources,
leading to a standstill. Deadlocks can be avoided using techniques such as resource ordering,
avoiding nested locks, and implementing timeouts.
20.​State the concept of a race condition and how to prevent it.

A race condition occurs when two or more threads access shared data simultaneously, and
the outcome depends on the order of execution. It can be prevented by using
synchronization mechanisms such as locks, mutexes, or atomic operations.

PART – C

1.​ Explain the key principles of structured programming. How do these principles improve
the maintainability and readability of code?

2.​ Discuss the importance of coding styles and coding standards in software development.

3.​ (i) What are the different types of documentation in software development, and why are
they important? Discuss the role of inline comments, API documentation, and user
manuals in improving software development and maintenance.

(ii)​ How can poor documentation affect the lifecycle of a software project?

4.​ (i) Explain the concepts of static and dynamic type checking in programming languages.
Compare the advantages and disadvantages of each with examples from languages like C
(static typing) and Python (dynamic typing).
(ii) Discuss the importance of user-defined data types and how they help in organizing
complex data structures.

5.​ Describe the mechanism of exception handling in modern programming languages. Why
is it essential for building robust applications?

6.​ What are concurrency mechanisms in programming, and why are they important in
modern software systems? Discuss the different approaches to concurrency, including
threading, multiprocessing, and asynchronous programming.

You might also like