click below
click below
Normal Size Small Size show me how
Computer Science
| Question | Answer |
|---|---|
| What is an Abstract Data Type (ADT)? | |
| Why is an Abstract Data Type called 'abstract'? | Because it provides an implementation-independent view of data, showing only essential details while hiding the specifics of how the operations are implemented. |
| What does an ADT specify and not specify? | It specifies what operations can be performed, but not how data is organized in memory or how the operations are carried out. |
| List the main characteristics of an Abstract Data Type (ADT). | 1. Facility to create a container to hold data; 2. Facility to add a new element; 3. Facility to remove an element that meets a criterion; 4. Facility to find an element that meets a criterion; 5. Facility to destroy the container when no longer needed. |
| What does 'implementation-independent' mean in the context of ADTs? | It means that the ADT describes operations and behavior without depending on any specific way of implementing or storing the data. |
| How does abstraction help in programming with ADTs? | It simplifies development by focusing on what operations an ADT performs rather than how it performs them, improving modularity and reusability. |
| Stack | A linear data structure where elements are arranged in order and all operations occur at one end called the top; follows the LIFO (Last In, First Out) principle. |
| Stack Underflow | Occurs when attempting to pop an element from an empty stack. |
| Stack Overflow | Occurs when attempting to push an element onto a full stack. |
| Real-life Example of Stack | A pile of plates — the last plate added is the first to be removed (LIFO). |
| Applications of Stack | Undo/Redo operations, browser back/forward navigation, expression evaluation, recursion, and backtracking problems. |
| Queue | A linear data structure where insertion happens at the rear and deletion happens at the front; follows the FIFO (First In, First Out) principle. |
| Queue Operations | Enqueue (insert), Dequeue (remove), Peek/Front (view first), Size (count elements), isEmpty (check if empty), isFull (check if full). |
| Difference Between Stack and Queue | Stack is LIFO (last in, first out) while Queue is FIFO (first in, first out). |
| Real-life Examples of Queue | People standing in a line, print spooling, CPU scheduling, data buffering. |
| Linked List | A linear data structure consisting of nodes connected by pointers; each node contains data and a pointer to the next node. |
| Linked List Operations | Get (retrieve), Insert (add), Remove (by value), RemoveAt (by position), Replace (update), Size (count), isEmpty (check if empty). |
| Difference Between Linked List and Array | Arrays use contiguous memory and allow random access; linked lists use pointers, dynamic memory, and no random access. |
| Advantages of Linked List | Dynamic size and easy insertion/deletion of nodes. |
| Disadvantages of Linked List | No random access, extra memory for pointers, and less cache-friendly. |
| Singly Linked List | A list where each node has data and a pointer to the next node only. |
| Linked List Representation | Each node has two parts: data (stores element) and next (stores address of next node); the list starts with a pointer called head. |
| Searching | The process of finding the location of a specific element in a collection of data. |
| Linear Search | A simple search algorithm that checks each element of the list sequentially until the desired element is found or the list ends. |
| How Linear Search Works | Starts from the first element and compares each one with the target until a match is found or the list is fully traversed. |
| Time Complexity of Linear Search | O(n) — where n is the number of elements in the list. |
| Limitation of Linear Search | It is inefficient for large data sets because it checks every element. |
| Binary Search | A search algorithm that works on sorted lists by repeatedly dividing the search interval in half. |
| How Binary Search Works | Compare the target element with the middle element; if it matches, stop; if smaller, search the left half; if larger, search the right half. |
| Condition for Binary Search | The list must be sorted in ascending or descending order before performing the search. |
| Time Complexity of Binary Search | O(log n) — where n is the number of elements. |
| Advantage of Binary Search | Much faster than linear search for large, sorted lists. |
| Disadvantage of Binary Search | Requires the data to be sorted before searching. |
| Sorting | The process of arranging data elements in a specific order, typically ascending or descending. |
| Selection Sort | A simple comparison-based algorithm that repeatedly selects the smallest (or largest) element and swaps it into its correct position. |
| How Selection Sort Works | Find the smallest element and place it at the beginning; repeat for the remaining unsorted portion until the list is sorted. |
| Time Complexity of Selection Sort | O(n²) — for both best and worst cases. |
| Space Complexity of Selection Sort | O(1) — sorts in place using no extra space. |
| Advantage of Selection Sort | Simple to understand and implement. |
| Disadvantage of Selection Sort | Inefficient for large lists due to its O(n²) time complexity. |
| Bubble Sort | A simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. |
| How Bubble Sort Works | On each pass, adjacent elements are compared and swapped; after each pass, the largest element "bubbles up" to the end. |
| Flag in Bubble Sort | A Boolean variable used to track if any swaps occurred during a pass; if no swaps occur, the list is already sorted and the algorithm stops early. |
| Time Complexity of Bubble Sort | Worst and average case: O(n²); Best case (already sorted): O(n). |
| Advantage of Bubble Sort | Easy to implement and understand. |
| Disadvantage of Bubble Sort | Very inefficient for large lists. |
| How many parameters can a push function have? | data item, array, size of array |
| What are support functions? | isEmpty( ), isFull( ) |
| Software Development | The structured approach is needed due to dependence on software, rising costs, user dissatisfaction, complexity, need for standard interfaces, better control, visibility, risk management, and end-user/management involvement. |
| User-Designer Communication Gap | Caused by differences in background, vocabulary, priorities, and problem-solving approaches between users and IS specialists. |
| Benefits of User Involvement | Better alignment with needs, greater acceptance, improved system quality, and smoother change management. |
| Importance of Management Involvement | Ensures commitment, resource allocation, project priority, and higher likelihood of success. |
| Attributes of Well-Engineered Software | |
| Four Fundamental Software Process Activities | |
| SDLC Stages | Project Identification & Selection → Initiation & Planning → Analysis → Logical Design → Physical Design → Implementation → Maintenance. |
| Main Process Models | Waterfall, evolutionary development, formal systems development, reuse-oriented model. |
| Waterfall Model Weakness | Inflexible and difficult to handle requirement changes. |
| Types of Evolutionary Development | Exploratory development and throw-away prototyping. |
| Advantage of Evolutionary Development | Fast feedback and improved requirement understanding. |
| Disadvantage of Evolutionary Development | Poor structure low visibility and specialized tool requirements. |
| Formal Systems Development | Uses mathematical specifications and transformations to produce correct programs. |
| Weakness of Reuse-Oriented Development | Requires requirement compromises and loses control over component evolution. |
| Incremental Development | Builds system in prioritized functional increments. |
| Advantages of Incremental Development | Early delivery reduced risk improved feedback and more testing of core services. |
| Spiral Model Unique Feature | Explicit risk analysis at each loop. |
| Types of Software Risks | Project risks product risks business risks. |
| Requirements Engineering | Process of defining required system services and constraints. |
| Types of Requirements | User requirements system requirements software specification. |
| Functional Requirements | Describe system services reactions to inputs and behavior in situations. |
| Non-Functional Requirements | Constraints such as performance usability security and standards. |
| Why NFRs Can Be Critical | If unmet the system may be unusable even if functionally correct. |
| Domain Requirements | Requirements from the problem domain or environment. |
| CASE Definition | Computer-Aided Software Engineering tools supporting analysis design coding and testing. |
| What is a Data Flow Diagram (DFD)? | A graphical representation of how data moves between external entities processes and data stores in a system. |
| Purpose of a DFD | To visualize systems identify inefficiencies map existing systems and plan improvements. |
| External Entity (Source/Sink) | Represents something outside the system that sends data to or receives data from the system. |
| How to label External Entities? | Using singular nouns. |
| Definition of a Process in a DFD | Work or actions performed on data to transform store or distribute it. |
| How to label Processes? | Using verb phrases. |
| Definition of a Data Store | Data at rest representing information stored by the system. |
| How to label Data Stores? | Using noun phrases with no verbs. |
| Definition of a Data Flow | Shows data in motion using arrows that depict movement between system elements. |
| What should NOT be in Data Flow labels? | Verbs. |
| Purpose of DFD Symbols | To visually represent how data enters moves through and exits a system. |
| What is a Context Diagram? | The highest-level DFD showing the entire system as a single process interacting with external entities. |
| Detail level of a Context Diagram | Broad and simple with little system detail. |
| What is a Level 1 DFD? | A breakdown of the context diagram's single process into multiple subprocesses. |
| What additional elements appear in Level 1 DFDs? | Subprocesses additional data flows and data stores. |
| How many DFD levels can exist? | Multiple levels such as Context Level 1 Level 2 and Level 3. |
| Advantages of DFDs (1) | Simple to understand and helpful for defining system boundaries. |
| Advantages of DFDs (2) | Useful for communicating system knowledge and explaining data flow logic. |
| Are DFDs used in documentation? | Yes they are often included in system documentation. |