Cyber Programming Midterm Flashcards

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/50

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:59 PM on 3/18/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

51 Terms

1
New cards

robustness, adaptability, reusability

In object-oriented programming (OOP) and software development, ______, ______, and _______ are core design principles that describe the quality of well-designed software.

2
New cards

Robustness

_________ is the ability of the software to handle errors, invalid input, and unexpected situations without crashing or behaving incorrectly.

3
New cards

Adaptability

_______ is the ability of software to change or be extended easily when requirements evolve, without rewriting large parts of the code.

4
New cards

Reusability

_________ is the ability to use the same code in multiple programs or parts of a program without duplication.

5
New cards

classes, objects

In object-oriented programming, you write _____ that represent real-world things and situations, and you create _____ based on these classes.

6
New cards

When you write a class, you….

define the general behavior that a whole category of objects can have.

7
New cards

automatically equipped withe the general behavior;

When you create individual objects from the class, each object is…. you can then give each object whatever unique traits you desire.

8
New cards

instantiation

Making an object from a class is called ______.

9
New cards

instances

You can work with _____ of a class.

10
New cards

information that can be stored, actions that can be taken

In classes, you’ll specify the kind of …. in instances, and you’ll define …. with these instances

11
New cards

Principles of OOP

  1. Encapsulation

  2. Inheritance

  3. Polymorphism

  4. Abstraction

12
New cards

Encapsulation

  • Bundles data (attributes) and methods (functions) into a single unit — the class.

  • Protects internal state by using private variables and methods

Example: You can hie details and expose only what’s necessary

13
New cards

Inheritance

  • Allows one class to inherit properties and methods from another

  • Promotes code reuse and logical hierarchy

Example: A Dog class can inherit from an Animal class.

14
New cards

Polymorphism

  • Let's different classes respond to the same method name in different ways

15
New cards

Abstraction

  • Hides complex implementation details and shows only essential features.

  • Helps simplify code and focus on what an object does, not how it does it.

16
New cards

Method

A function that is a part of a class

17
New cards

It is a constructor/special method that Python runs automatically whenever we create a new instance of a class.

What is the __init__ method?

18
New cards

object attribute, specific object

An _____ ______ belongs to a ______ _______. It is usually defined in the init using self.

19
New cards

Every method call associated with an instance automatically passes self, which is a reference to the instance itself; it gives the individual instance access to the attributes and methods in the class.

True

20
New cards

Any variable prefixed with self is available to every method in the class, and we’ll also be able to access these variables through any instance created from the class.

True

21
New cards

Use an object attribute when the value:

  • Belongs to the object

  • Doesn’t change often

  • Describes the object’s state or identity

22
New cards

Use a method parameter when the value:

  • Is temporary

  • Changes each time the method is called

  • Describes how the action is performed, not what the object is

23
New cards

Polymorphism

  • Different objects can use the same method name but behave differently

  • Python supports it because it’s dynamically typed

24
New cards

Inheritance

A fundamental concept in OOP that allows a class (called a child or subclass) to programming inherit properties and behaviors (methods and attributes) from another class (called a parent or superclass).

25
New cards

Inheritance enables…

  • Code reuse: Common functionality can be written once in the parent class and reused by child classes.

  • Hierarchy modeling: You can represent real-world relationships (ex. Dog is an Animal)

  • Extensibility: Child classes can add or override functionality without modifying the parent class

26
New cards

Method Overriding

When a subclass provides its own implementation of an inherited method so that the subclass version is used instead of the parent’s version when the method is called.

27
New cards

Method extension

When a subclass overrides a method but still calls the parent class’s version.

28
New cards

Key Characteristics of Method Extensions

  • You can override the method in the subclass

  • You can call the method super().method()

  • You can add new behavior before or after that call

29
New cards

LIFO

Last-In First-Out

30
New cards

LIFO principle

A stack is a collection of objects that are inserted and removed according to the _____ _______.LI

31
New cards

most recently inserted object

You can insert objects into a stack at any time but may only access or remove the _____ _____ _____ _____.

32
New cards

Stack examples

  • Internet web browsers store the addresses of recently visited sites in a stack

  • Text editors “undo” button

  • Implementation of recursion in programming languages.

33
New cards

push(e)

Adds element e to the top of the stack

34
New cards

pop()

Removes and returns the top element from the stack (or null if the stack is empty)

35
New cards

peek() or top()

Returns the top element of the stack. It doesn’t remove the element.

36
New cards

size()

Returns the number of elements in the stack.

37
New cards

isEmpty()

Returns a Boolean indicating whether the stack is empty.

38
New cards

Encryption & Decryption

  • Some encryption algorithms use stacks to reverse data or manage operations in a specific order.

  • For example, reversing a message before encryption or during decryption can be done using a stack.

39
New cards

Parsing & Validation

  • Stacks are used in validating expressions, such as checking for balanced parentheses in code or data formats

  • This is useful in input validation, which is a key part of preventing injection attacks.

40
New cards

Log File Analysis

  • Cybersecurity professional often analyze logs to detect anomalies, intrusions, or failures. Since logs are typically appended chronologically.

  • Reading in reverse allows you to quickly access the most recent events.

  • Useful for incident response, where time is critical and you want to see what happened just before a breach

41
New cards

Crash or Error Diagnostics

  • If a system crashes or an application fails

  • The last few lines of a log file often contain the error messages or stack traces

  • Reverse reading helps isolate the root cause quickly.

42
New cards

Queue Characteristics

  • It is a relative — cousin of stack data structure

  • FIFO principle — first in, first out

  • We usually say that elements enter a queue at the back and are removed from the front.

43
New cards

enqueue(e)

Adds element to the end (rear) of the queue.

44
New cards

dequeue()

Removes and returns the element from the front of the queue

45
New cards

peek(), first()

Returns the first element of the queue. It doesn’t remove the element.

46
New cards

size()

Returns the number of elements in the queue.

47
New cards

isEmpty()

Returns a Boolean indicating whether the queue is empty.

48
New cards

Examples of Queues

  • Scheduling processes in multitasking systems

  • Managing requests in print or disk queues

  • Queues in call centers or ticket booking system to ensure first-come, first-served service.

  • Packeting Processing

    • Network packets arrive continuously

    • A queue helps store packets temporarily before inspection

    • This ensures orderly processing an avoids packet loss during high traffic

  • Email or Message Filtering

    • Incoming messages are queued for spam or phishing analysis

    • This helps prevent malicious content from reaching users

49
New cards

deque

_____ is a special type of data structure. It’s prefered over a list for queues because both append() and popleft() run in O(1) time. No shifting needed

50
New cards

append()

adds an element to the right end of the deque.

51
New cards

popleft()

removes and returns the element from the left end of the deque

Explore top notes

note
Data Acquisition
Updated 1073d ago
0.0(0)
note
Oxidative Phosphorylation
Updated 1191d ago
0.0(0)
note
economics
Updated 416d ago
0.0(0)
note
Tools of Foreign Policy
Updated 1241d ago
0.0(0)
note
Art Notes - Sem 2 2024
Updated 507d ago
0.0(0)
note
Lord of the Flies
Updated 707d ago
0.0(0)
note
Data Acquisition
Updated 1073d ago
0.0(0)
note
Oxidative Phosphorylation
Updated 1191d ago
0.0(0)
note
economics
Updated 416d ago
0.0(0)
note
Tools of Foreign Policy
Updated 1241d ago
0.0(0)
note
Art Notes - Sem 2 2024
Updated 507d ago
0.0(0)
note
Lord of the Flies
Updated 707d ago
0.0(0)

Explore top flashcards

flashcards
Latin quiz 1 review
46
Updated 268d ago
0.0(0)
flashcards
GLW #2
20
Updated 180d ago
0.0(0)
flashcards
ETS RC 2023 - TEST 01 PART 5
130
Updated 913d ago
0.0(0)
flashcards
Unit 8: Clinical Psychology
64
Updated 1079d ago
0.0(0)
flashcards
APUSH Midterm
42
Updated 100d ago
0.0(0)
flashcards
Latin quiz 1 review
46
Updated 268d ago
0.0(0)
flashcards
GLW #2
20
Updated 180d ago
0.0(0)
flashcards
ETS RC 2023 - TEST 01 PART 5
130
Updated 913d ago
0.0(0)
flashcards
Unit 8: Clinical Psychology
64
Updated 1079d ago
0.0(0)
flashcards
APUSH Midterm
42
Updated 100d ago
0.0(0)