ECE Anki Cards Flashcards

1
Q

What does computing even mean?,

A

Computing refers to using algorithmic, mathematical, or logical processes to manipulate and process information, historically evolving from mechanical calculation to complex digital computation.

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

Why do we use base 10 (decimal) in everyday life?,

A

Because humans have historically counted using their ten fingers, making base 10 a natural and intuitive system for everyday arithmetic.

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

Why do we perform computation in base 2 (binary) in modern computers?,

A

Modern computers use binary (0s and 1s) because it directly corresponds to the on/off states of electronic components, making it reliable and efficient for digital circuits.

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

What did the term ‘computer’ mean back in the 1800s?,

A

In the 1800s, a ‘computer’ referred to a person who performed calculations by hand or with mechanical tools.

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

What was Babagge’s main motivation for working on a mechanical computer?,

A

Charles Babbage wanted to reduce human calculation errors by automating arithmetic with a reliable, mechanical computing machine.

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

Why do we perform computations in electrical forms instead of mechanical forms?,

A

Electrical signals switch much faster, scale down more easily, and are more reliable and efficient than mechanical components.

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

What are the two main inventions that revolutionized computing? Why are they important?,

A

Transistors and integrated circuits revolutionized computing by making it possible to create smaller, faster, more reliable, and more powerful computing devices.

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

What’s the benefit of a transistor over a vacuum tube?,

A

Transistors are smaller, produce less heat, consume less power, are more reliable, and switch faster than vacuum tubes.

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

Why do computational demands get heavier as time goes by?,

A

As technology and needs evolve, we tackle more complex problems and process larger data sets, continually increasing computational requirements.

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

When will we have enough computation? How much is enough?,

A

There is no fixed point at which computation is ‘enough.’ As capabilities grow, new applications emerge, perpetually increasing demand.

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

How do you define a computer?,

A

A computer is an electronic device that accepts input, processes data according to instructions, stores information, and produces output.

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

State two example of input devices.,

A

Keyboard, Mouse.

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

State two example of output devices.,

A

Monitor, Printer.

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

What does ‘CPU’ stand for? What is the role of CPU?,

A

CPU stands for Central Processing Unit. It executes instructions, performs arithmetic/logic operations, and acts as the ‘brain’ of the computer.

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

Why do modern computers need ‘memory’?,

A

Memory stores instructions and data for quick access, enabling the CPU to execute programs efficiently.

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

What does ALU stand for? Where do the terms ‘Arithmetic’ and ‘Logic’ come from?,

A

ALU stands for Arithmetic Logic Unit, named because it performs arithmetic operations (e.g., addition) and logical operations (e.g., comparisons).

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

What parameters distinguish different CPUs? state two parameters.,

A

Parameters include clock speed (in GHz) and number of cores.

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

What does ISA stand for? What does it mean?,

A

ISA stands for Instruction Set Architecture, defining the set of instructions and operations a CPU can execute.

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

Why do we need both ‘RAM’ and ‘SSD’?,

A

RAM is fast, volatile memory for active computation, while SSD provides slower but persistent, non-volatile storage for programs and data.

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

What does memory hierarchy mean? How can it improve performance? Make a real-life analogy.,

A

The memory hierarchy layers storage by speed and cost (registers, cache, RAM, SSD/HDD). Frequently used data stays in faster memory to improve performance. Analogy: Like keeping frequently needed items on your desk and less-used documents in a filing cabinet.

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

How many different things can you encode with n bits?,

A

2^n different values.

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

What does a program mean?,

A

A program is a sequence of instructions a computer can execute to perform a task.

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

What does software mean?,

A

Software is a collection of programs, data, and instructions that run on hardware, enabling various functionalities.

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

What is an operating system?,

A

An operating system manages hardware resources, provides common services for software, and facilitates user interaction with the computer.

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

State two roles of the operating system.,

A

Managing resources (CPU, memory, I/O) and providing interfaces (GUI, CLI) for users and applications.

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

What does ‘standard input’ refer to? what does ‘standard output’ refer to?,

A

Standard input typically refers to the keyboard input stream. Standard output typically refers to the screen/console output stream.

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

What does ‘GUI’ stand for? what does it mean?,

A

GUI stands for Graphical User Interface, an interface that uses visual elements like windows and icons.

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

What does ‘CLI’ stand for? What does it mean?,

A

CLI stands for Command Line Interface, an interface where the user types text commands.

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

What does the drone hovering condition mean?,

A

Hovering means the drone stays stable in mid-air, not moving up, down, or sideways.

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

Why do we need propellers on a drone? At a high level, how could a drone fly upwards? How could it move left or right? How could it land?,

A

Propellers generate lift. Increasing propeller speed lifts the drone, adjusting thrust distribution moves it sideways, and reducing thrust allows it to descend and land.

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

Why do the rotational direction of propellers matter for a stable flight operation?,

A

Opposite rotational directions counteract torque, preventing uncontrolled spinning and ensuring stable flight.

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

What does ‘Abstraction’ mean? How is it useful?,

A

Abstraction hides complexity by providing simpler interfaces, making systems easier to understand, use, and maintain.

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

What does programming even mean?,

A

Programming is creating a set of instructions that a computer follows to perform tasks or solve problems.

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

Why do we need programming languages?,

A

They provide a human-readable way to write instructions for computers and bridge the gap between human logic and machine execution.

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

What does ‘machine code’ or ‘object code’ mean?,

A

Machine code is the low-level, binary form of a program that the CPU can execute directly.

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

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

A

High-level languages are more abstract, human-readable, and portable. Low-level languages are closer to hardware, less portable, and harder to read.

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

Which one is portable? Which one is more human readable? Which one needs a comprehensive knowledge of hardware? etc.,

A

High-level languages are portable and human-readable; low-level languages require deep hardware knowledge.

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

What is the difference between a compiler and an interpreter?,

A

A compiler translates the entire program before execution; an interpreter executes the program line-by-line at runtime.

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

Which one is faster? Which one is more interactive?,

A

Compiled programs often run faster; interpreters are more interactive and suitable for rapid development.

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

What does Java’s ‘WORA’ concept mean?,

A

‘Write Once, Run Anywhere’ means Java code can run on any platform with a compatible JVM, without modification.

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

What was the main motivation behind Java’s invention?,

A

To create a portable, secure, and network-friendly language suitable for a wide range of devices and environments.

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

Define the following terms associated with a programming language: Universality (Turing Completeness), Syntax, Semantics,

A

Universality (Turing Completeness) means the language can theoretically solve any computable problem. Syntax defines the structure of code. Semantics defines the meaning or behavior of that code.

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

How does Java aim to implement the ‘WORA’ concept?,

A

By compiling source code into platform-independent bytecode that runs on the JVM, ensuring code portability.

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

What is the name of the java compiler?,

A

The Java compiler is called ‘javac’.

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

What does a byte code mean?,

A

Bytecode is a platform-independent intermediate code executed by the JVM.

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

What does JVM stand for? On a high-level, what’s the job of JVM?,

A

JVM stands for Java Virtual Machine. It runs Java bytecode, provides memory management, and ensures platform independence.

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

What does an IDE stand for? What’s its job?,

A

IDE stands for Integrated Development Environment. It provides tools (editor, debugger, compiler) to streamline software development.

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

What does a Java package mean?,

A

A package is a namespace to group related classes and avoid naming conflicts.

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

Which package is imported by default?,

A

java.lang is imported by default.

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

What does Java class library mean?,

A

It’s a collection of pre-written classes and interfaces providing core functionality (data structures, I/O, networking, etc.).

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

What does ‘import java.util.ArrayList;’ do?,

A

It allows the direct use of the ArrayList class without needing to fully qualify its name.

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

What does ‘import java.util.*’ do?,

A

It imports all classes and interfaces in the java.util package.

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

What are the purpose of adding comments to codes? How can you make a single line or multi-line comment?,

A

Comments clarify code. Single-line: // comment. Multi-line: /* comment */.

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

What does javadoc mean? How can you create comment that can be used by javadoc?,

A

Javadoc is a documentation tool. Use /** … */ comments before classes, fields, and methods to generate documentation.

55
Q

What does an algorithm mean?,

A

An algorithm is a step-by-step procedure to solve a problem or perform a task.

56
Q

What are the three basic control structures for implementing an algorithm?,

A

Sequence, Selection (if/else), and Iteration (loops).

57
Q

What is the main motivation behind defining variables?,

A

Variables allow storing and reusing data under symbolic names, making programs flexible and maintainable.

58
Q

What happens in hardware when we declare a variable (e.g., after int i = 20;)?,

A

Memory is allocated for an integer, and the value 20 is stored at that memory location. The variable name maps to this location.

59
Q

What does a data type mean?,

A

A data type specifies the kind of data stored and operations allowed on that data.

60
Q

What are the two main data types in Java?,

A

Primitive types (int, double, etc.) and Reference types (objects, arrays).

61
Q

Amount of memory used in Java for int, double, char, and boolean data types,

A

int: 4 bytes, double: 8 bytes, char: 2 bytes, boolean: not strictly defined but typically 1 byte or optimized.

62
Q

Is 5 the same as 5.0 in java?,

A

No, 5 is an int literal, 5.0 is a double literal.

63
Q

Variable declaration and assignment,

A

For example: int i = 20; declares i as an integer and assigns 20.

64
Q

Operations on the data types: e.g., 1+3*4%3 = ?,

A

3*4=12, 12%3=0, 1+0=1, so result is 1.

65
Q

j = i++; vs j = ++i;,

A

j = i++ returns i then increments i, j = ++i increments i first then returns the new value.

66
Q

Shorthand operators (*=, +=, etc.),

A

x += 5; is x = x + 5; and similarly for other operators.

67
Q

NaN & Infinity,

A

Floating-point types can represent NaN (Not a Number) and ±Infinity for out-of-range or undefined operations.

68
Q

Why do we need ASCII? What standard does Java use to represent characters? Why?,

A

ASCII standardizes character codes. Java uses Unicode for broader language support and global compatibility.

69
Q

Why would opening an image with a text reader display gibberish?,

A

Because image files are binary data, not text. A text reader interprets bytes as characters, producing nonsense.

70
Q

What is an ‘Escape Sequence’? What does \n do?,

A

Escape sequences represent special characters. \n inserts a newline.

71
Q

What is the type and value of (‘b’ - ‘a’)?,

A

Type: int. Value: 1 (since ‘b’ is one code unit after ‘a’).

72
Q

What is the type and value of (6 | 8) in java? What about (6 & 8)? What about (6 ^ 8)?,

A

6|8 = 14, 6&8 = 0, 6^8 = 14. All results are int.

73
Q

Comparison operators,

A

==, !=, <, >, <=, >= compare values and produce boolean results.

74
Q

Is String a reference type or a primitive type?,

A

String is a reference type.

75
Q

What package contains the String class?,

A

The java.lang package.

76
Q

What does ‘+’ do with String operands?,

A

It concatenates the strings.

77
Q

How do we ask for the end-user’s input in Java?,

A

Typically using a Scanner object with System.in.

78
Q

What’s the difference between next() and nextInt() when asking for user’s input?,

A

next() reads a String token, nextInt() reads an integer value.

79
Q

What does a ‘literal’ mean?,

A

A literal is a fixed value in code, like 42 or ‘Hello’.

80
Q

String indices…,

A

Strings are zero-indexed, first character at index 0.

81
Q

String.subString(start, end), String.length(), String.indexOf(),

A

subString extracts a portion, length() returns length, indexOf() finds a character’s position.

82
Q

What do ‘Implicit’ and ‘Explicit’ casting mean?,

A

Implicit casting automatically converts types (int to double), explicit casting requires a cast operator (double to int).

83
Q

Assignment compatibilities,

A

Some types assign without casting (int to long), others require explicit casting.

84
Q

Explicit cast concepts,

A

(int)5.7 truncates to 5, for example.

85
Q

How do we cast a String as an integer or double?,

A

Use Integer.parseInt(string) or Double.parseDouble(string).

86
Q

Concepts about if , if / else, if / else if, Nested if / else, Ternary Operators, Switch / Case constructs,

A

These are conditional structures for branching logic based on conditions.

87
Q

Compound Boolean Expressions,

A

Use && (AND), || (OR) to combine multiple conditions.

88
Q

Testing equality for Strings,

A

Use str.equals(otherString) instead of ‘==’ which compares references.

89
Q

Concepts about while / do while / for / Nested loop constructs,

A

Loops repeat code execution until a condition is met. do-while executes at least once, for is often used with counters.

90
Q

Write code for finding max, min, average of 5 variables using loops,

A

Use an array, iterate, track max/min, sum for average.

91
Q

Definition and purpose of data structures,

A

Data structures organize and store data efficiently for access and modifications.

92
Q

Basic characteristics of arrays, including core properties, memory organization, Syntax and declaration, Indexing, Size limitations,

A

Arrays have fixed size, contiguous memory, zero-based indexing, and store elements of one type.

93
Q

Default values,

A

Numeric arrays default to 0, booleans to false, references to null.

94
Q

Array operations: How to create arrays, How to access elements, How to modify elements, How to iterate through arrays,

A

Created with new, accessed via arr[i], modified by assignment, iterated with loops or for-each.

95
Q

Multi-dimensional arrays: Basic concepts, Creation and access, Memory structure,

A

Arrays of arrays. int[][] arr = new int[m][n]. Access with arr[i][j].

96
Q

Array copying concepts: Difference between shallow and deep copies, Aliasing,

A

Shallow copy duplicates references, deep copy duplicates the data. Aliasing occurs when two references point to the same array.

97
Q

Common array-related errors: Index out of bounds, Null pointer exceptions,

A

Happen if you access invalid indices or use a null reference.

98
Q

Memory considerations: How arrays are stored, Reference vs primitive types,

A

Arrays are objects stored on the heap. Primitive arrays store values directly, reference arrays store references to objects.

99
Q

Basic comparison with other data structures: Linked Lists, Hash Tables,

A

Arrays have O(1) random access but fixed size, linked lists are flexible but slower for random access, hash tables handle fast lookups but need hashing.

100
Q

Basic array applications and use cases,

A

Storing collections of elements, iterating, sorting, searching.

101
Q

Basic function concepts: Definition and purpose, Mathematical vs programming perspective, Why we use functions,

A

Functions (methods) encapsulate code for reuse, clarity, and modularity.

102
Q

Function syntax in Java: Declaration, Components (access modifiers, return types, parameters), Naming conventions,

A

e.g., public static int add(int a,int b){…} defines a method named add with int parameters.

103
Q

Main method: Special characteristics, Role as entry point,

A

public static void main(String[] args) is where Java programs begin execution.

104
Q

Return values: void vs return types, Return statement behavior, Multiple returns,

A

void methods don’t return values; others must return a value matching their return type. Multiple returns allowed but must match declared type.

105
Q

Function overloading: Definition, Rules, Signatures,

A

Multiple methods with the same name but different parameter lists.

106
Q

Function calling: Within same class, From different classes, Parameter passing,

A

Methods are called by name and arguments passed by value.

107
Q

Variable scope: Local variables, Parameter scope, Access rules,

A

Local variables exist only within their method/block scope.

108
Q

Pass by value: Primitive types, Reference types, Behavior differences,

A

Java always passes by value. For primitives, value is copied; for references, the reference is copied, pointing to the same object.

109
Q

Recursion: Basic concept, Base case, Recursive step, Common examples, Stack limitations,

A

A method calling itself with a base case to end recursion. Too deep recursion can cause stack overflow.

110
Q

Definition of signals,

A

Signals are varying quantities (e.g., voltage) representing information.

111
Q

Analog vs Digital,

A

Analog is continuous, digital is discrete.

112
Q

Sampling & Quantization,

A

Conversion of analog signals to digital form by sampling at intervals and rounding values.

113
Q

Why can’t we use digital computers to (naively) process analog signals? Where are the sources of loss of information?,

A

Because digital representations are discrete, continuous analog data must be sampled and quantized, losing detail if sampling is not high enough.

114
Q

Sensors vs Actuators,

A

Sensors convert physical quantities to signals; actuators convert signals to physical actions.

115
Q

Image Representation (How many bytes to store a m by n color image?),

A

For RGB (3 bytes per pixel), size = m * n * 3 bytes.

116
Q

Idea behind Caesar Ciphers algorithm,

A

Shift each letter by a fixed number in the alphabet.

117
Q

Why do we need to compress data?,

A

To reduce storage space and transmission time.

118
Q

What do lossy & loss-less compression mean?,

A

Lossless retains all data perfectly, lossy discards some data for smaller size.

119
Q

Concepts about representing numbers in hardware, Unsigned integers, signed integers (sign-magnitude and two’s complement format),

A

Binary representation, unsigned use all bits for value, signed integers can represent negatives using sign-bit or two’s complement for simpler arithmetic.

120
Q

Abstract Data Types (ADT): Definition and purpose, Relation to built-in data types,

A

ADTs define operations abstractly, without implementation details, guiding design and usage.

121
Q

What does OOP even mean?,

A

Object-Oriented Programming structures software around objects that combine data and methods.

122
Q

Difference between class, Object, Fields (Data Attributes) & Methods (behaviors),

A

A class is a template, objects are instances, fields hold data, methods define behavior.

123
Q

Class Components: Fields/Attributes, Methods/Behaviors, Constructors, Access modifiers,

A

Classes contain data (fields), operations (methods), constructors for initialization, and access modifiers for visibility.

124
Q

Special Methods: Constructor methods, toString(), equals(), Getters & Setters,

A

Constructors initialize objects, toString provides a string representation, equals checks content equality, getters/setters access fields.

125
Q

What does the static keyword mean?,

A

static members belong to the class, not instances.

126
Q

Differences between static and instance methods.,

A

Static methods don’t require an object, instance methods operate on a specific object’s data.

127
Q

Definition of the following OOP concepts: Encapsulation, Abstraction, Inheritance,

A

Encapsulation hides internal details, abstraction focuses on essential aspects, inheritance allows classes to derive from others.

128
Q

Java-specific OOP Implementation: Syntax for class definition, Object creation and manipulation,

A

Classes defined with ‘class’, objects created with ‘new’, fields/methods accessed via references.

129
Q

Java Generics: Purpose and benefits, Type parameters, Implementation in classes and methods,

A

Generics allow type-parameterized classes and methods, increasing safety and reusability.

130
Q

Wrapper classes vs primitive types,

A

Wrapper classes are object representations of primitives, enabling them to be used in collections. Autoboxing/unboxing convert between them automatically.

131
Q

Arrays of Objects: Declaration and initialization,

A

e.g., MyClass[] arr = new MyClass[5]; creates an array of references to MyClass objects.

132
Q

What does a Java interface mean?,

A

An interface defines methods (no implementation) that implementing classes must provide.

133
Q

Object Sorting: Arrays.sort() method, Comparable interface, compareTo() method for custom sorting logic,

A

Arrays.sort uses compareTo from Comparable to determine order. compareTo returns negative/0/positive values for sorting.

134
Q

Only concepts about designing a DFA (e.g., design a DFA to detect ‘100’ pattern).,

A

A DFA is a theoretical model with states and transitions used to recognize patterns in input strings by moving between states based on input symbols.