Computer Science Flashcards

1
Q

What is “git?”

A

Git is a distributed version control system (DVCS) that allows you to track changes in your codebase, collaborate with others, and manage different versions of your software project. It is widely used in software development to keep track of changes made to source code files and to facilitate collaboration among developers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a FORTRAN compiler and what does it do?

A

A FORTRAN compiler is a software tool that translates source code written in the FORTRAN programming language into machine code or an intermediate representation that can be executed by a computer’s CPU.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is GDB and how is it used to help troubleshoot code?

A

GDB, which stands for GNU Debugger, is a powerful and widely used open-source debugger for troubleshooting and analyzing code in various programming languages, including C, C++, and Fortran. It is part of the GNU Project and is available on many platforms, including Windows, Linux, and macOS.

GDB allows developers to examine and manipulate the execution of a program, making it a valuable tool for diagnosing and fixing software issues.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a JSON file and what purpose does it have in Microsofts Visual Studio Code application?

A

A JSON file, which stands for JavaScript Object Notation, is a lightweight and human-readable data interchange format used to store and exchange structured data. JSON files are often used in software development to represent data in a format that is easy for both humans and machines to understand. JSON is language-independent and widely supported in various programming languages and applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is FORTLS and what does it do?

A

fortls stands for Fortran Language Server. It is a tool used in programming environments, especially in code editors and Integrated Development Environments (IDEs), to provide features like code completion, symbol searching, and documentation on hover.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a “path” and what is its purpose?

A

In computing, a “path” refers to the location of a file or directory within a file system hierarchy. It specifies the route to access a file or directory from the root of the file system or from a specified starting point.

The purpose of a path is to uniquely identify the location of a file or directory within the file system. Paths are used by operating systems and applications to locate and manipulate files and directories. They provide a standardized way to reference files and directories, enabling users and programs to access and work with them efficiently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between a high and low level programming language?

A

High-Level Programming Language:

High-level languages are designed to be easily understandable by humans and are closer to natural language.
They provide a higher level of abstraction, allowing developers to write code that is more concise, readable, and portable across different platforms.
High-level languages typically have built-in features and constructs that abstract away the details of the underlying hardware, such as memory management and CPU architecture.
Examples of high-level languages include Python, Java, C#, JavaScript, and Ruby.

Low-Level Programming Language:
Low-level languages are closer to the hardware and provide more direct control over the computer’s resources.
They have a lower level of abstraction, meaning that code written in low-level languages is more closely related to the actual hardware and machine operations.
Low-level languages often require more detailed knowledge of the computer’s architecture and may involve manual memory management and CPU register manipulation.
Low-level languages are typically more efficient in terms of execution speed and memory usage, as they allow for fine-grained control over hardware resources.
Examples of low-level languages include assembly language and machine code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is object oriented programming?

A

Object-oriented programming (OOP) is a programming paradigm that revolves around the concept of “objects,” which are instances of classes. In OOP, objects can contain data, in the form of attributes or properties, and code, in the form of methods or functions. The key principles of object-oriented programming include:

Encapsulation: Encapsulation refers to the bundling of data and methods that operate on the data into a single unit or object. This helps in hiding the internal state of an object and only exposing the necessary functionality through well-defined interfaces. Encapsulation allows for better organization and maintenance of code.

Abstraction: Abstraction involves simplifying complex systems by modeling them at a high level of abstraction. In OOP, abstraction is achieved through classes, which act as blueprints for creating objects. Classes define the properties and behaviors that objects of that class will exhibit, without specifying the implementation details. This allows developers to focus on what an object does rather than how it does it.

Inheritance: Inheritance is a mechanism by which a class can inherit properties and behaviors from another class, called the superclass or base class. This promotes code reusability and allows for the creation of hierarchical relationships between classes. Subclasses inherit the attributes and methods of their superclass and can also add new attributes or methods or override existing ones.

Polymorphism: Polymorphism allows objects of different classes to be treated as objects of a common superclass. This allows for more flexible and modular code, as it enables the use of generic interfaces to manipulate objects of various types. Polymorphism is often achieved through method overriding and method overloading.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is SQL?

A

SQL, which stands for Structured Query Language, is a standard programming language specifically designed for managing and manipulating relational databases. It is used for querying, updating, inserting, and deleting data from databases, as well as for creating, modifying, and managing database schema (structure).

SQL is a declarative language, meaning that users specify what they want to achieve without necessarily specifying how to achieve it. The database management system (DBMS) interprets SQL commands and executes them accordingly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is an encryption algorithm?

A

An encryption algorithm is a mathematical procedure used to transform plaintext into ciphertext. There are various encryption algorithms available, each with different characteristics in terms of security, speed, and complexity. Examples include Advanced Encryption Standard (AES), Rivest Cipher (RC), and Data Encryption Standard (DES).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a cryptographic key?

A

A cryptographic key is a piece of information used by the encryption algorithm to control the encryption and decryption processes. There are two main types of encryption keys: symmetric keys and asymmetric keys.

Symmetric Encryption: In symmetric encryption, the same key is used for both encryption and decryption. This means that both the sender and the recipient need to possess the same secret key. Examples of symmetric encryption algorithms include AES and DES.

Asymmetric Encryption: In asymmetric encryption, a pair of keys is used: a public key and a private key. The public key is used for encryption, while the private key is used for decryption. Asymmetric encryption enables secure communication between parties without the need to share a secret key. Examples of asymmetric encryption algorithms include RSA and Elliptic Curve Cryptography (ECC).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is malware?

A

Malware, short for “malicious software,” refers to any type of software specifically designed to disrupt, damage, or gain unauthorized access to computer systems, networks, or data, often without the knowledge or consent of the user. Malware encompasses a wide range of malicious programs and code, including viruses, worms, Trojans, ransomware, spyware, adware, and rootkits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a computer core?

A

`
In the context of computing, the term “core” typically refers to a processing unit within a central processing unit (CPU) or a processing element within a multi-core processor.

A computer core, also known as a CPU core or processing core, is an individual processing unit within a CPU that can execute instructions and perform calculations. Each core within a CPU is capable of independently executing instructions, which allows for parallel processing and multitasking.

Modern CPUs often contain multiple cores, with each core capable of executing its own set of instructions simultaneously. These multi-core processors are designed to improve performance by increasing the overall processing power and efficiency of the CPU.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are some of the top super computers in the US?

A

Frontier – Located at the Oak Ridge National Laboratory (ORNL) in Tennessee, Frontier is an exascale supercomputer designed to deliver over 1.5 exaflops of peak processing power, making it one of the most powerful supercomputers in the world.

Summit – Also housed at ORNL, Summit was the world’s fastest supercomputer until it was surpassed by Frontier. It has a peak performance of 200 petaflops (200 quadrillion calculations per second) and is used for a variety of computational tasks, including energy, artificial intelligence, and human health research.

Sierra – Located at the Lawrence Livermore National Laboratory in California, Sierra is primarily used for nuclear weapons simulation as part of the National Nuclear Security Administration’s Advanced Simulation and Computing Program. It has a peak performance of about 125 petaflops.

Perlmutter – Housed at the National Energy Research Scientific Computing Center (NERSC) at the Lawrence Berkeley National Laboratory, Perlmutter is designed for data-intensive science and AI workloads, supporting a wide range of projects from cosmology to genomics.

Frontera – Located at the Texas Advanced Computing Center (TACC) at the University of Texas at Austin, Frontera is one of the most powerful academic supercomputers, designed to support the most demanding scientific computations for researchers across the United States.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are examples of high level programing languages?

A

Python
C++
JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the main two examples of low level programming languages?

A
  1. Machine code
  2. Assembly Language
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a “class” in programing?

A

A class is a blueprint that defines:

What kind of data something can hold (called properties or attributes)
What actions it can perform (called methods or procedures)

When you actually use a class, you create what’s called an “instance” or “object” from that blueprint.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is an abstract class in FORTRAN?

A

An abstract class in Fortran is a special kind of class that can’t be used directly - it’s meant to serve as a template for other classes to build upon.

Example:
module shapes

implicit none

type, abstract :: shape
    contains
        procedure :: area => calc_area
        procedure :: perimeter => calc_perimeter
end type shape

abstract interface
    function calc_area(this) result(res)
        import :: shape
        class(shape), intent(in) :: this
        real :: res
    end function calc_area

    function calc_perimeter(this) result(res)
        import :: shape
        class(shape), intent(in) :: this
        real :: res
    end function calc_perimeter
end interface

end module shapes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is an interface in fortran?

A

An interface in Fortran is a way to define how a procedure (subroutine or function) should look - its “contract” or specification. It defines what arguments the procedure takes and returns, without specifying how it actually works.

module computations

implicit none

interface compute
    module procedure compute_integer
    module procedure compute_real
end interface

contains

function compute_integer(x) result(res)
    integer, intent(in) :: x
    integer :: res
    res = x * x
end function compute_integer

function compute_real(x) result(res)
    real, intent(in) :: x
    real :: res
    res = x * x
end function compute_real

end module computations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is an abstract base class in FORTRAN?

A

In Fortran, an abstract base class is defined using the ABSTRACT attribute. This concept is part of Fortran’s object-oriented programming features introduced in Fortran 2003. An abstract base class cannot be instantiated directly; instead, it serves as a blueprint for other derived types.

Here are some key points about abstract base classes in Fortran:

Abstract Attribute: The class is marked with the ABSTRACT keyword, indicating that it is an abstract type.

Deferred Bindings: Abstract classes can contain deferred bindings, which are procedures that must be implemented by any non-abstract derived types. These are specified using the DEFERRED attribute.

Polymorphism: Abstract classes can be used to define polymorphic objects, allowing for dynamic dispatch of procedures.

21
Q

What is a deferred procedure in FORTRAN?

A

Deferred procedures in Fortran are a key feature of its object-oriented programming capabilities, introduced in Fortran 2003. They allow you to define procedures in an abstract base class that must be implemented by any derived class. Here’s a more detailed explanation:

> Deferred Attribute: A procedure is marked as deferred using the DEFERRED attribute. This indicates that the procedure does not have an implementation in the abstract base class and must be implemented in any non-abstract derived class.

> Abstract Types: Deferred procedures can only be specified in abstract types, which are defined using the ABSTRACT keyword. An abstract type cannot be instantiated directly.

> Polymorphism: Deferred procedures enable polymorphism, allowing different derived types to provide specific implementations of the same procedure, which can be called dynamically at runtime.

22
Q

What are common procedures (concrete methods) in FORTRAN?

A

In Fortran, common procedures, also known as concrete methods, are fully implemented procedures that can be used directly in your programs. These procedures can be either functions or subroutines, and they are not marked with the DEFERRED attribute.

23
Q

What does “inheritance” mean with respect to FORTRAN OOP?

A

Inheritance in Fortran’s object-oriented programming (OOP) allows you to create new types (derived types) that are based on existing types. This mechanism promotes code reusability and hierarchical relationships between types.

Base and Derived Types: Inheritance involves a base type (also known as a parent type) and a derived type (also known as a child type). The derived type inherits all the components and procedures of the base type.

Type Extension: The EXTENDS keyword is used to define a derived type that extends a base type. This allows the derived type to inherit the properties and methods of the base type.

Overriding Procedures: Derived types can override procedures from the base type to provide specific implementations. This is done using the PROCEDURE keyword.

24
Q

What is a “pure” function in FORTRAN? What three criteria does it have to meet to be considered pure?

A

In Fortran, a pure function is a function that is free of side effects. This means it does not modify any global variables, perform I/O operations, or alter its input arguments. To be considered pure, a function must meet the following criteria:

  1. All arguments must have the INTENT(IN) attribute: This ensures that the input arguments are not modified within the function.
  2. No modification of global variables: The function should not change any global state.
  3. No I/O operations: The function should not perform any input/output operations.
25
Q

What does the keyword “elemental” mean in fortran?

A

In Fortran, the elemental keyword is used to define functions or subroutines that can be applied element-wise to arrays. This means that an elemental procedure can take an array as an argument and apply the function to each element of the array independently.

26
Q

What is CMake in simple terms?

A

CMake is like a recipe book for building software. It tells a computer how to compile code into an execuatble or library.

It can handle things such as:
1. Finding dependencies
2. Configuring a build process
3. Gernating build files such as a makefile.

CMake can be used with different operating systems, making it versatle across different machines.

27
Q

What is the difference between CMake and a regular build file?

A

CMake:

> Platform-independent: Can generate build files for various platforms (Windows, macOS, Linux, etc.).
High-level: Defines the overall structure of the project and its dependencies.
Generates build files: Creates Makefiles, Visual Studio projects, or other platform-specific build files.

Makefile:

> Platform-specific: Typically written for a specific platform (often Unix-like systems).
Low-level: Specifies the exact commands needed to compile and link source code files.
Directly controls the build process: Executes the commands defined within it.

28
Q

What is MPI?

A

MPI, or Message Passing Interface, is a standard for writing parallel programs. It allows multiple processes to communicate and coordinate with each other, often across multiple machines.

29
Q

What is a root directory?

A

It’s the main folder that contains all other folders and files on your computer.

On Windows, it’s often represented as “C:” or “D:”.
On macOS and Linux, it’s represented by a single slash “/”.

30
Q

What is a runtime error?

A

A runtime error is an error that occurs while a program is running. This means that the program has successfully compiled and started executing, but encounters an issue that prevents it from continuing correctly.

Common causes of runtime errors include:
1. Division by zero: Trying to divide a number by zero.
2. Accessing an invalid memory location: Trying to read or write data from a memory address that doesn’t exist.
3. Infinite loops: A loop that never ends.
Incorrect input: Providing invalid input to the program.
4. Insufficient resources: Lack of memory or other resources needed to run the program.

31
Q

On windows machines, why are there usually two program file directories (Program files, and program files x86)

A

The reason for two “Program Files” directories on Windows is to accommodate both 32-bit and 64-bit applications.

Here’s a breakdown:

Program Files: This directory is for 64-bit applications.
Program Files (x86): This directory is for 32-bit applications. The “(x86)” part indicates that these programs are designed to run in a 32-bit environment, even on a 64-bit Windows system.

32
Q

What is a “bit?”

A

A bit is the smallest unit of data in computing. It can have only two values: 0 or 1. Think of it like a tiny switch that can be either on (1) or off (0).

Bits are combined to form larger units of data, like bytes. Eight bits make up one byte.

33
Q

What is meant by the “program” or “varible” scope?

What are the different types of scope in FORTRAN specifically?

A

In programming, scope refers to the region of a program where a variable or other identifier is recognized and can be used. It defines the visibility and lifetime of a variable.

Types of Scope in Fortran:

  1. Local Scope: Variables declared within a subroutine or function are local to that specific block of code. They are only accessible within that block and cease to exist when the block finishes execution.
  2. Global Scope: Variables declared within a module are accessible from any program unit that uses that module. They exist throughout the entire program’s execution.
34
Q

Explain what a FORTRAN library is.

A

A Fortran library is a collection of pre-compiled routines or modules that can be linked to a Fortran program to extend its functionality.

Libraries are useful for:
1. Efficiency: Once a library is compiled, it’s transformed into a pre-built collection of machine code (instructions the computer understands directly).

  1. Reusability: This pre-compiled code can be linked to multiple programs without the need to recompile the library code itself every time.
35
Q

What is the difference between static and dynamic libraries in fortran?

A

Static Libraries

How they work:

The library’s code is directly incorporated into the executable file during the linking process. The executable becomes self-contained, meaning it doesn’t rely on external files to run.

Pros:
Easy to distribute: The executable is standalone.
No dependency issues: The specific version of the library used is embedded within the executable.

Cons:
Larger executable size: The library code increases the size of the executable file.
Less flexible: If the library needs to be updated, the entire executable must be rebuilt and redistributed.

%———————————————————
Dynamic Libraries (also known as Shared Libraries)

How they work:

The library code remains separate from the executable file. The executable contains information about where to find the library at runtime. The operating system loads the library into memory when the program starts.

Pros:
Smaller executable size: The executable only contains references to the library.
More flexible: Updates to the library can be made without rebuilding the executable.
Reduced memory usage: Multiple programs can share the same copy of the library in memory.

Cons:
Dependency issues: The program may not run if the required library is missing or incompatible.
Runtime loading overhead: There’s a slight overhead in loading the library at runtime.

36
Q

Cybersecurity Topic
What is a rootkit?

A

A rootkit is a type of malware that provides privileged, root-level access to a computer or network while concealing its presence. This allows malicious actors to control the infected system without the user’s knowledge. Rootkits are often used to steal sensitive data, launch attacks, or create botnets. They are difficult to detect and remove because they hide within the system’s core files and processes.

37
Q

What is wsl and why is it useful?

A

WSL stands for Windows Subsystem for Linux.

It lets you run a full-fledged Linux environment directly within Windows.
You can install and use popular Linux distributions like Ubuntu, Debian, and others.

This means you can access Linux tools, commands, and applications without needing a separate virtual machine or dual-booting your computer.

In other words, WSL is like having a separate Linux computer running alongside your Windows installation.

38
Q

Explain what a linux “kernal” is.

A

The Linux kernel is the core of the Linux operating system. Here’s a breakdown:

Core of the Operating System: It’s the central component that manages all the hardware and software resources of the computer.

Interface Between Hardware and Software: It acts as a bridge between the computer’s hardware (CPU, memory, disk drives, network cards, etc.) and the software applications that run on the system.

39
Q

What is Ubuntu?

A

Ubuntu is a popular and widely used free and open-source operating system based on the Debian Linux distribution.

40
Q

What does mnt mean in a wsl path? For example:
/mnt/c/Users/bryan/OneDrive/CU/Code/LD-Chem-Mark5$

A

In WSL (Windows Subsystem for Linux), the /mnt directory is a mount point where Windows drives (like C:, D:, etc.) are made accessible from the Linux file system.

When you access /mnt/c/, you are effectively navigating to C: on the Windows side.
All the files and folders on your C: drive are mirrored here, so /mnt/c/Users/ corresponds to C:\Users\ on Windows.

Your path /mnt/c/Users/bryan/OneDrive/ is equivalent to C:\Users\bryan\OneDrive\ on Windows.

41
Q

What does the VS Code command “Connect to WSL in Distro…” mean?

A

“Connect to WSL in Distro” in Visual Studio Code, it means you’re connecting to a specific Linux distribution (distro) that you have installed via the Windows Subsystem for Linux (WSL). This allows you to open a terminal and run commands within that Linux environment directly from VS Code. It’s like having a full Linux system running alongside your Windows OS, making it easier to use Linux tools and workflows without leaving your Windows setup.

42
Q

What does “sudo apt” mean in wsl?

A

sudo: This stands for “superuser do.” It allows you to run commands with superuser (root) privileges. Some tasks, like installing or updating software, require these elevated permissions.

apt: This is the package management tool used by Debian-based Linux distributions, like Ubuntu. It stands for “Advanced Package Tool” and is used to install, update, and remove software packages

43
Q

How do you check to see what packages are available for updates in wsl?

A

sudo apt update

44
Q

How do you update the installed packages in wsl?

A

sudo apt upgrade

45
Q

What is “Bash?”

A

Bash (Bourne Again SHell) is a command-line interface and scripting language used primarily in Unix-based operating systems like Linux and macOS. It’s the default shell for most Linux distributions and macOS, providing users with a text-based way to interact with the computer’s operating system.

46
Q

What are shell initialization files?

A

These are special configuration files that run automatically when you start a new shell session. They’re like a set of personal instructions that customize your command-line environment.

The typical initialization files it searches for include:

.bashrc: A personal configuration file for interactive non-login shells
.bash_profile: A configuration file for login shells
.profile: A more general initialization file used by various shells

47
Q

What is the difference between an abstract interface and an explicit interface in FORTRAN?

A

Explicit Interface:
An explicit interface is when the compiler knows exactly what a procedure (subroutine or function) looks like before it’s called. This happens in two primary ways:

Internal Procedures: When a procedure is defined within the same program unit, the compiler automatically knows its details.
Module Procedures: When procedures are defined within a module and used with a use statement, the compiler has full knowledge of their structure.

Abstract Interface:
An abstract interface is like a template or blueprint for a procedure. It defines the structure a procedure must have but doesn’t provide the actual implementation. Think of it as a contract that says, “Any procedure using this interface must look like this.”
Key characteristics of abstract interfaces:

Define a standard shape for procedures
Allow for polymorphic use of procedures
Enable creating procedure pointers or passing procedures as arguments
Don’t contain an actual implementation

48
Q

What is a “Unix-environment?”

A

In the early days of computing, researchers at Bell Labs created an operating system called Unix. Think of an operating system as the fundamental software that manages your computer’s resources and lets you interact with the hardware. Unix was designed with some key philosophies that still influence computing today - particularly the ideas that programs should do one thing well and should be able to work together easily.

A Unix environment refers to an operating system that follows these Unix principles and provides a similar set of tools and interfaces. The most well-known example today is Linux, which was created as a free alternative to Unix. MacOS is another example - it’s built on a Unix-like foundation called Darwin. When people talk about a Unix environment, they’re usually referring to these kinds of systems.

49
Q

What are the three fundamental characteristics of a unix like Environements?

A
  1. They use a hierarchical file system that starts at a root directory (/) and builds from there. Your home directory might be /home/username instead of C:\Users\username as in Windows.
  2. They follow the principle that “everything is a file” - even devices and system resources are treated as files you can read from or write to.
  3. They emphasize text-based interfaces and the ability to chain programs together using “pipes” (|) to create more complex operations.