General Flashcards

1
Q

Are mathematicians geniuses, per Michael Nielsen?

A

“Many top mathematicians have, through hard work, internalized more complex mathematical chunks than ordinary humans. Rather than having an inherently more powerful brain, their prior learning has given them better chunking abilities, and so situations most people would see as complex they see as simple, and they find it much easier to reason about.”

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

What is the single largest barrier to understanding a complex topic, per Michael Nielsen?

A

Memory of the basics

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

What is the central idea of the book “The Magical Number Seven, Plus or Minus Two”?

A

Each person can keep about 7 chunks of information in working memory. Larger chunks effectively increase working memory. Experts know enough small pieces of information to form larger chunks of information that effectively boost their IQ in specific domains.

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

What are Mortimer Adler’s Four Levels of Reading?

A

Elementary reading, Inspectional reading, Analytical reading, Syntopical reading

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

Francis Bacon on reading

A

“Some books are to be tasted, others to be swallowed, and some few to be chewed and digested”

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

What does it mean to have an internal locus of control?

A

It means that an individual takes responsibility for events in his or her life. Someone with an external locus of control blames outside forces for bad things that happen. Psychological research indicates that people with an internal locus of control tend to have better professional outcomes.

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

Per Ray Dalio, why do ideas cause us mental pain?

A

Closemindedness: we become too attached to an idea, so it is painful when a person or event comes along to challenge it.

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

Socialism vs Communist

A

Socialism involves a state that controls business and the distribution of wealth.

Communism is stateless and involves the people directly owning the means of production.

Socialism is said to be the precursor to Communism. There have been no successful Communist states.

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

Why is email free?

A

It’s not actually free - data is gathered and used to advertise to you.

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

Hermes Trismegistus

A

A legendary figure associated with Hermes and Thoth that is regarded by Neoplatonists as the author of Hermetic Corpus, the sacred texts of Hermeticism. These texts systemize cult practices to offer adherents a means of ascension from physical limitations.

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

Gnosis

A

Empirical, experienced-based knowledge, as opposed to theoretical knowledge or epistemology.

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

Impact of Hermeticism

A

Hermetic texts were rediscovered in the 15th century and served as one of the catalysts for the Renaissance.

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

CPU

A

A central processing unit is the electronic circuitry within a computer that carries out computer instructions by performing I/O, logic, arithmetic, and controlling operations.

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

Multiple CPUs vs. Distributed system

A

CPUs on a machine share memory, capping the total number of jobs that can be done at once. A distributed system does not rely on a shared memory and can therefore do jobs that would be impossible on a single machine with many CPUs.

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

Sharding

A

Splitting a large piece of data into pieces for storage on different nodes. Two strategies for doing this are based on either a record’s key or a hash of that key.

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

Replication

A

Data is repeated across nodes for better safety and ease of access. Often happens in conjunction with sharding. A node can contain replicas of several different shards.

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

Synchronous vs. asynchronous replication

A

In synchronous replication, the leader replica waits for confirmation from follower replicas before it indicates to the user that the data has been inserted. In asynchronous replication, the leader does not wait.

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

What is the main reason for sharding?

A

Scalability.

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

How many partitions does a piece of data belong to?

A

One.

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

How many processes can listen on a port in a machine?

A

One.

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

Lock

A

A lock or mutex is a method that enforces synchronization by limiting access to a resource in a situation where there are multiple threads that might try to do so.

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

Mutex

A

A mutual exclusion is an object that prevents threads from simultaneously accessing a shared resource.

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

Concurrency vs. parallelism

A

Concurrency is when many tasks are being processed at the same time; parallelism is when a task is split into subtasks for parallel execution.

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

Load balancing

A

Traffic/requests are distributed among cells to prevent the overloading of any one cell.

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

There are three main types of tests. What are they?

A

Unit tests, integration tests, functional tests. Unit tests identify specific breaking components. Integration tests examine the interactions between components. Functional tests are end-to-end and are the largest test.

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

What does it mean when a test is fragile?

A

The test is likely to fail when code is changed, even if the change shouldn’t break the test.

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

How can decoupling be used to write tests?

A

Testing a component along with all of its dependencies can result in not knowing where an issue stems from. A solution to this is decoupling the tested class from its dependencies. A mock dependency that returns a specific value can be created so that the test targets only the class that needs to be tested.

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

Templating language

A

In the context of UI, a templating language makes it possible to reuse HTML and UI components. Like JS, there are variables that can be dynamically replaced and sometimes control statements (if, or). This helps to reduce replication and increase reuse of code.

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

Autoescaping

A

In a template, autoescaping helps to prevent XSS vulnerabilities that result from dynamic text from an untrusted source being embedded into an HTML document. Text is converted - for example, angle brackets are turned into < and >.

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

Batch processing

A

When a script runs a program using JCL (Job Control Language) without human interaction. This typically occurs at night, during the batch window.

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

BLOB data type

A

Binary large object - a long binary string stored as data in a database. Can represent images, etc.

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

Interleaved memory

A

When using dynamic random-access memory, spreading memory addresses evenly across memory banks. Contiguous reads and writes use one memory bank after another, reducing wait times.

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

Deterministic test

A

A test that behaves as one would expect. A non-deterministic test might fail in some instances and pass in others, without a noticeable change in the code.

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

Integration test

A

A test that combines N components with their interactions, where N is less than the total system.

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

Pairwise test

A

A type of integration test where services are tested with exactly one dependency at a time. This helps to ensure that each dependency impacts implementation in the expected way.

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

Regression test

A

A test that is written when a bug is found, and that passes once the bug is fixed.

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

Benchmark testing

A

A test that measures the latency or throughput of code.

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

Load testing

A

A test that shows a system reacts when user traffic increases. This helps developers understand when more resources are needed to scale the system and meet demand.

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

Canary testing

A

When a small amount of traffic is diverted to a new version of a system before releasing the new version.

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

What is the general rule of thumb for ratio of unit / integration / end-to-end tests?

A

85 unit / 10 integration / 5 end-to-end

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

MVC

A

MVC is an architectural design pattern that separates an application into three parts: the model, the view, and the controller. The goal of this is to separate different parts of functionality. The model represents data management and interacts with the database or data file. The view is the UI. The controller sits in between, receiving user input, making calls to model objects, updating the view, and providing dynamic data to the view.

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

Kernel

A

The core of a computer’s operating system: has complete control over everything in the system.

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

Buffer

A

A temporary store for data, to solve for a difference between input and output speed. A streamed video, for example, has a buffer in order to prevent users for waiting for the video to load.

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

What is a trap in a user process?

A

A synchronous interrupt caused by an exceptional condition where control is temporarily passed to the operating system (kernel mode) before being returned to the originating process.

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

What does REST stand for?

A

Representational State Transfer

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

API

A

An application programming interface is a predefined set of methods used by components to communicate with one another.

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

Hypermedia

A

An extension of hypertext, where users can click not only text, but images, movies, graphics, and other media.

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

Why is REST considered stateless?

A

Client-server communication is closed once the response comes back. A new request does not have access to client context that sticks around between requests.

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

What is a RESTful web service?

A

A service that allows requests to be made via a stateless and standardized set of operations (GET, POST, PUT, DELETE).

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

What is the main difference between REST and RPC?

A

REST has predefined functions (GET, POST, PUT, DELETE) on a resource. RPC is a way to remotely execute a specific function by name. So sending an email with REST might involve a POST followed by a GET, while sending an email with RPC might simply involve a sendEmail function that is called “directly” by the consumer without REST abstractions.

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

TCP

A

Transmission Control Protocol is a standard that defines how to create and maintain a network connection allowing applications to exchange data.

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

IP

A

The Internet Protocol defines how computers send packets of data to one another.

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

How does RPC result in tight coupling between client and service implementation?

A

Clients need to know server procedures by name and signature in order to use their functionality. If procedures are changed on the server side, client code must also change or else the application will break.

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

IDL

A

An Interactive Data Language is a programming language used for data analysis.

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

What is the difference between data-intensive and compute-intensive applications?

A

Data-intensive applications have bottlenecks due to the volume, storage, and complexity of data, whereas compute-intensive applications are limited by CPU clock speeds.

56
Q

Why has processing speed increased over the last several years?

A

CPU clock speeds have not really increased. Rather, there are more multi-core processors, faster networks, and more parallelism.

57
Q

According to the book Designing Data-Intensive Applications, what are the 3 crucial elements of a good data system?

A

Reliability, scalability, maintainability

58
Q

Cache invalidation

A

Updated data is marked as out-of-date in a cache.

59
Q

Rolling update

A

A node or several nodes are updated at a time, but the system as a whole remains up during the update.

60
Q

What is the difference between a fault and a failure?

A

Fault is when one element of a system does not behave as expected. A failure is when the entire system is compromised.

61
Q

Fault-tolerance

A

The ability of a system to perform even when there are faulty elements/some unexpected behavior.

62
Q

Cluster

A

A collection of machines/nodes that are grouped together via a shared network infrastructure. The cluster has a master node that determines where to run jobs.

63
Q

Request handler

A

A file that contains application logic to handle a request.

64
Q

Service vs. Server

A

A server provides services. A service is a component that performs operations in the background without a user interface.

65
Q

What are the benefits of using microservices?

A

The use of microservices is a design pattern that breaks up a monolithic server into smaller, modular pieces. This makes horizontal scaling easier. Traffic can be balanced more easily, as microservices with larger loads can be scaled up. There is also less of a chance of a failure in one microservice impacting other microservices.

66
Q

Dependency injection

A

An abstraction technique that decouples code from lower level implementations by automatically creating dependencies. Dependencies no longer have to be manually added in via instantiation. This makes it easier to replace one implementation of a dependency with another.

67
Q

Dependency injection container

A

This is a file that contains a map of injectable dependencies. If you want to swap out a dependency, you only have to touch this file.

68
Q

Reverse proxy

A

A reverse proxy grabs the correct resources for a client when there are multiple servers involved.

69
Q

RPC

A

A remote procedure call is a request for info or action between components of applications based on a predefined API. Can be contrasted with REST.

70
Q

Protocol buffer

A

A way of encoding structured data that was developed by Google. Similar to JSON, but lacks curly braces and is therefore smaller to store.

71
Q

What are the benefits of a distributed system?

A

Multiple cores in a computer share memory so there is a limit to how fast things can be done. A distributed system can distribute computing among processors that aren’t competing for memory. This increases scalability at the expense of more complexity.

72
Q

Computing task

A

A task is defined differently by different operating systems. In some, it is a process; in others, a thread.

73
Q

Thread vs Process vs Tag

A

?

74
Q

RAM

A

Random-access memory is a form of data storage where data and code that is currently being used is stowed. This data can be read and written at the same quick speed regardless of the physical location of the data in the memory.

75
Q

XML vs HTML

A

Both use tags to describe content.HTML: describes how to format info for display, meant for computer/human interaction. XML: describes what the information is, meant for computer/computer interaction.

76
Q

MVVM

A

Model-view-viewmodel is an architectural pattern. The GUI (View) is separated from the business logic (Model) by the ViewModel. The ViewModel massages data so it is ready for management and presentation. There is two-way data binding between the View and ViewModel, automating communication between the two and removing the need to write boiler-plate for synchronization.

77
Q

MVC

A

Model-view-controller is an architectural pattern. The Model, View, and Controller are decoupled, allowing for better reuse and parallel development. The Controller sits between the View and the Model, accepting input and issuing commands to both. MVC was one of the first attempts to implement software in terms of separate responsibilities.

78
Q

DSL

A

Domain-specific language. A language specialized to a particular application domain or solution. This is in contrast with a general-purpose language that can be used for many purposes.

79
Q

Declarative programming

A

A paradigm that expresses the logic of a computation, but not its control flow. Says what the program must accomplish, rather than how. This is in contrast with imperative programming.

80
Q

Imperative programming

A

A paradigm that consists of a set of commands for a computer to perform to change a program’s state. Says how a program accomplishes something, rather than why.

81
Q

First-class functions

A

A programming language has first-class functions if it treats functions as first-class citizens. This means that functions support operations generally available to other entities: can be arguments to other functions, returned, assigned to variables, and stored in data structures.

82
Q

Coupled classes

A

Coupling describes the degree to which a class depends on another class. At least one of the classes knows about the other.

83
Q

Loose coupling

A

If class A and B are loosely coupled, a change in class B is not very likely to impact class A, which has B as a dependency. This is good because it becomes possible to change one part of a program without affecting others.

84
Q

Encapsulation

A

A class hides its internal details from other classes, and offers a strict API for other classes to communicate with it.

85
Q

Class

A

A set of objects that are similar.

86
Q

Object

A

An entity that contains a group of encapsulated data and procedures.

87
Q

Interface

A

In OOP, a means of defining method signatures while deferring the actual implementation of those methods.

88
Q

Service

A

A software functionality or set of functionalities that different clients can reuse for different purposes. The service also includes a prescribed interface and usage policies.

89
Q

Object-oriented program

A

A program implemented by interacting objects, which are entities that contain groups of encapsulated data and procedures.

90
Q

When can inheritance result in tight coupling?

A

When subclasses depend on implementation details of a parent class.

91
Q

Static import

A

Used when static members of a class need to be imported into another class without referring to the class they belong to.

92
Q

Hard dependency

A

Tbd

93
Q

Java static keyword

A

Used to designate a member of a class that isn’t associated with a particular instance of that class. Can be accessed via the class itself, or as a static import.

94
Q

Static state

A

Another word for a global state that is shared between all instances of a class. Undesirable as it causes program state to be unpredictable via side effects (if instances modify global state). If there is no way to predict outputs, there is no way to test.

95
Q

Loose coupling

A

Elements depend on each other to the least extent possible. Components can interact without knowing about each other’s inner workings. This is desirable because components are more reusable, flexible, and testable. Often achieved via dependency injection.

96
Q

Inversion of Control

A

A class with a dependency does not create or find it. Rather, the dependency is passed to (injected into) the passive component.

97
Q

How do interfaces reduce tight coupling?

A

The client code is coupled to the interface rather than to the implementing code. The interface can therefore be implemented by multiple classes in multiple ways. Classes don’t rely on implementation details, but interfaces instead.

98
Q

Abstraction

A

The client is only shown the functionality of a piece of code; implementation details are hidden.

99
Q

Javabean

A

A Java class that has the following characteristics: implements Serializable; has a public no-arg constructor; private properties with public getter and setter methods.

100
Q

Java Reflection API

A

An API that allows an object to see the constructors, methods, and fields of its incoming class. Methods and fields can be invoked and changed at runtime regardless of their access specifiers.

101
Q

Binding

A

Generally speaking, the mapping of one thing to another. In the context of dependency injection, bindings specify how dependencies are resolved.

102
Q

Static import

A

Needed when importing a static member of a class for direct use.

103
Q

Dependency injection

A

A technique where one object supplies the dependencies of another object, as opposed to the receiving object instantiating its own dependencies.

104
Q

Static cling

A

An antipattern where static state is used in more and more parts of an application in an attempt to get the application to do what is expected.

105
Q

Static cling

A

An antipattern where static state is used in more and more parts of an application in an attempt to get the application to do what is expected. The application becomes a huge, specialized, unreusable monolith that is impossible to test.

106
Q

Programming to interface

A

An OOP principle that states that clients should be programmed to rely on interfaces rather than on specific implementations. Implementations can be changed so long as they fulfill the interface contract.

107
Q

Interface vs abstract class

A

An interface is used to establish a contract - basically a list of all public methods the implementing classes will have (interface methods cannot be private, and variables can only be static).An abstract class is used to provide a mix of concrete implementations and list abstract methods that need to be fleshed out by child classes.

108
Q

Dagger lazy injection

A

By default, a dependency is instantiated as soon as the object that depends on it is instantiated. The Provides and Lazy annotations defer instantiation until a relevant getter is called.

109
Q

Dagger @Provides vs @Lazy

A

Both defer instantiation of dependencies until relevant getters are called.@Lazy memoizes; @Provides doesn’t.

110
Q

The primary goal of dependency injection

A

To eliminate static state/dependencies.

111
Q

How is Dagger different from other dependency injection frameworks?

A

Generates human-readable boilerplate code that makes it possible for relationships between components to be figured out at compile time rather than runtime.

112
Q

Polymorphism

A

tbd

113
Q

Subtyping

A

tbd

114
Q

Single-Responsibility Principle

A

Each class is responsible for one piece of functionality, and that responsibility should be completely encapsulated by that class. Multiple responsibilities lead to a lack of independence and more side-effects.

115
Q

Open/Closed Principle

A

Entities (classes, modules, functions…) should be open for extensions in functionality, but closed for modification of existing code. Otherwise, a change in a base class will require changes in dependent classes.

116
Q

Liskov Substitution Principle

A

Objects of a superclass can be replaced with objects of its subclass without breaking the application. Subclasses behave the same way as the parent class.

117
Q

Interface Segregation Principle

A

Keep interfaces relatively small and focused so that clients don’t have to depend on methods they don’t use.

118
Q

Dependency Inversion Principle

A

Two parts: 1. High-level modules should not depend on low-level modules. Both should depend on abstractions. 2. Abstractions should not depend on details. Details should depend on abstractions.

119
Q

How does Inversion of Control help decouple classes?

A

The usage of a class is separated from its creation. This can be useful if a dependency’s signature changes - if the dependency is instantiated in the dependent class, the dependent class must also change. This is also good for reusability.

120
Q

Framework vs Library

A

tbd

121
Q

Polymorphism

A

When a single symbol represents multiple entities of different types, or when a method is overridden and has different implementations at different levels.

122
Q

Java ‘throw’ vs. ‘throws’

A

Throw actually throws an error. Throws notifies the compiler that a method might throw a specific error and that at some point, one of the callers of that method must handle that potential error with a try/catch. Failure to specify will result in an error in compilation.

123
Q

What does NoSQL stand for?

A

Not only SQL.

124
Q

What are 3 driving forces behind the adoption of NoSQL?

A
  1. Need for greater scalability than relational databases could provide.2. Specialized query operations that weren’t supported by the relational model.3. Relational schemas were too restrictive to support dynamic data.
125
Q

Polyglot Persistence

A

Using different data storage technologies to handle different data needs in a single application.

126
Q

The Object-Relational / Impedance Mismatch

A

Relational tables store data in different formats than it is used in application code (as objects, JSON). There needs to be an awkward translation layer between the two to massage data into the correct format.

127
Q

3 ways to handle one-to-many joins in a relational table

A
  1. Normalization with foreign keys.2. Using structured datatypes to store multi-valued data in a single row.3. Store multi-valued data as a long JSON or XML string and let the application code interpret it.
128
Q

What are pros and cons to storing data as JSON?

A

Pros: bringing the structure of data closer to the way the application uses it, only one query (no joins), reduces the impedance mismatch, lack of a schema.Cons: Lack of a schema, receive the entire JSON document regardless of the relevance of certain fields.

129
Q

Normalization

A

The process of dividing large tables into smaller ones to reduce redundancy. These tables are linked via relationships. New data can be added without modifying old tables.

130
Q

Why is it important to use IDs instead of strings as identifiers in databases?

A

Anything that is meaningful to humans may need to change in the future. This makes future changes easier (only change the translation in one place) and more consistent (will never have the situation where only half of the records are changed).

131
Q

Denormalization

A

tbd

132
Q

Where was the Mayan underworld located?

A

Literally beneath the physical world: it could be accessed via holes in the Earth.

133
Q

In Mayan culture, what did the growth of maize represent?

A

Maize was a representation of the human lifecycle. Mayan kings such as K’inich Janaab’ Pakal of Palenque depicted themselves as reincarnations of the Maize God. Pakal was buried like a seed in water (jade), in the earth and ready to sprout once more.

134
Q

What does SERP stand for?

A

Search Engine Results Page

135
Q

Why does C++ have header (.h) files?

A

Each .cc code file is compiled independently, and the compiler has no knowledge of what fields are declared in other compilation units. The name of each field must be identical in all .cc files where it is used. Declaring fields separately in each .cc file is risky as it may cause errors.

With header files, you can define fields once and use them in all .cc files using the #include directive, which copies the header file to the .cc file.

136
Q

Builder pattern

A

tbd

137
Q

Service

A

A component that performs operations in the background without a user interface.