Bjarne Stroustrup Technology Lecture
- 92Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
92 questions
- 1C++ grew from the combination of C's close-to-the-hardware model and Simula's_____concepts.
Hint
Think of the mechanism Simula introduced for building user-defined abstractions.
Answer
class
- 2C's model of representing objects of the same type next to one another in memory supports structures such as_____.
Hint
This structure stores a sequence of same-type elements.
Answer
arrays
- 3C represents a collection of fields of different types grouped together as a_____.
Hint
This C construct groups unlike data fields.
Answer
struct
- 4Fortran helped shift programming from expressing machine operations toward expressing the_____.
Hint
This is what a programmer is trying to solve, rather than the details of the machine.
Answer
problem
- 5Simula's class system let programmers build their own_____instead of relying only on built-in data structures.
Hint
These let programmers represent domain-specific ideas, such as vectors or matrices.
Answer
abstractions
- 6C++ added constructors and destructors to help create and clean up_____.
Hint
These are instances of classes that may need initialization and cleanup.
Answer
objects
- 7One central goal of C++ is to improve_____so that many incorrect operations can be caught before runtime.
Hint
It concerns how reliably a language checks the types used in operations.
Answer
type safety
- 8C++ aims to support performance close to the_____when systems code needs it.
Hint
Think of the physical machine that executes the program.
Answer
hardware
- 9For hard real-time systems, operations must have predictable execution_____.
Hint
A real-time system may require a known upper limit on how long an operation takes.
Answer
time
- 10A design goal for C++ is that code complexity should be proportional to the complexity of the_____being performed.
Hint
This is the work the program is intended to accomplish.
Answer
task
- 11C++ is particularly aimed at efficient abstractions for systems, infrastructure, and resource-constrained_____.
Hint
These are programs or systems built to operate under limited resources.
Answer
applications
- 12Maintaining long-term_____is a reason C++ cannot simply discard every old feature.
Hint
It allows existing programs to keep working as the language evolves.
Answer
compatibility
- 13A resource must be acquired and later_____to the place it came from.
Hint
This is the opposite of acquiring a resource.
Answer
released
- 14Memory, file handles, communication connections, and locks are all examples of_____.
Hint
Programs acquire these items and must eventually give them back.
Answer
resources
- 15When allocated memory is not released, the program has a memory_____.
Hint
The resource remains unavailable because cleanup was missed.
Answer
leak
- 16A clear resource_____identifies which part of a program is responsible for cleanup.
Hint
This is the entity responsible for giving a resource back.
Answer
owner
- 17In resource acquisition is initialization, a resource is acquired as part of an object's_____.
Hint
The key idea connects obtaining a resource with setting up an object.
Answer
initialization
- 18With RAII, an object's destructor releases its resources when the object goes out of_____.
Hint
This is the region in which a local object exists.
Answer
scope
- 19A constructor can establish an object's_____; its destructor can tear that state down.
Hint
This is a condition that should remain true for a properly formed object.
Answer
invariant
- 20Standard containers such as vectors, strings, and maps manage their resources and clean up when they go out of_____.
Hint
Think about when a local container stops existing.
Answer
scope
- 21A vector of strings cleans up its elements by having the vector destroy each managed_____.
Hint
The vector contains objects that also have their own cleanup behavior.
Answer
string
- 22RAII helps ensure cleanup still happens when a function exits because of an_____.
Hint
This is an error-handling event that can interrupt the ordinary flow of execution.
Answer
exception
- 23A raw pointer is best used to refer to an object owned by_____rather than to hide responsibility for owning it.
Hint
The pointer can refer to an object without being responsible for its lifetime.
Answer
somebody else
- 24When one part of a program is the sole owner of a dynamically allocated object, a_____pointer expresses that ownership.
Hint
The name indicates that there is only one owner.
Answer
unique
- 25A shared pointer maintains a_____so it can determine when the last owner has gone away.
Hint
It tracks how many owners share the managed object.
Answer
use count
- 26Garbage collection does not automatically manage every kind of resource, such as file handles and locks; it primarily addresses_____.
Hint
This is the resource that garbage collection conventionally reclaims.
Answer
memory
- 27A shared pointer can impose coordination costs because its ownership_____is shared and updated by multiple owners.
Hint
This value tracks how many shared owners remain.
Answer
count
- 28If an object is not actually shared, using a shared pointer introduces a shared_____unnecessarily.
Hint
This is what the ownership count becomes when multiple pointers coordinate through it.
Answer
resource
- 29Returning a large object by value can be problematic if it requires an expensive_____.
Hint
This operation duplicates the object's representation.
Answer
copy
- 30Returning a raw pointer to a newly created object raises the question of who is responsible for its_____.
Hint
The issue is deciding who must eventually delete or clean up the object.
Answer
ownership
- 31Returning a reference to a local object does not solve ownership problems and can leave the caller with an invalid_____.
Hint
The caller receives an alias that may outlive the object it refers to.
Answer
reference
- 32A move operation transfers an object's_____instead of duplicating all of its contents.
Hint
For a matrix, this may include the internal pointer to its stored elements.
Answer
representation
- 33After transferring its representation, a move constructor leaves the source object in a state that can be safely_____.
Hint
The source no longer owns the transferred resource, but its lifetime still ends normally.
Answer
destroyed
- 34Moving a matrix can be inexpensive because its stored elements can remain in place while ownership of their representation is_____.
Hint
The destination takes over the existing storage rather than copying every element.
Answer
transferred
- 35A move constructor defines what it means to_____an object, while a copy constructor defines what it means to duplicate one.
Hint
This operation transfers the object's resources rather than duplicating them.
Answer
move
- 36If a class's members already know how to copy and move themselves, the compiler can often generate the class's special_____automatically.
Hint
These include the operations used to copy or move an object.
Answer
constructors
- 37Returning a new object directly expresses the intended value semantics more naturally than returning a pointer to the_____.
Hint
The caller should work with the matrix or shape itself, not an address to it.
Answer
object
- 38Unique ownership is usually preferable to shared ownership when an object has only one_____.
Hint
There is no need to track multiple parties if just one party controls the object's lifetime.
Answer
owner
- 39In object-oriented programming, inheritance is most useful when the concepts in a domain form a meaningful_____.
Hint
Shapes, circles, and triangles can be organized by more general and more specific categories.
Answer
hierarchy
- 40A circle that can be treated as a shape illustrates a hierarchical_____relationship.
Hint
The specific type can be described as a kind of the more general type.
Answer
is-a
- 41A virtual function supports runtime_____by allowing a call through a base interface to select a derived implementation.
Hint
One interface can invoke different implementations depending on the object's actual type.
Answer
polymorphism
- 42A class with an incompletely implemented interface can be made_____so it serves as a base rather than a complete object.
Hint
This kind of class cannot be instantiated as a fully concrete object.
Answer
abstract
- 43C++ supports interface inheritance as well as_____inheritance.
Hint
This kind of inheritance shares behavior or code in addition to an interface.
Answer
implementation
- 44The_____
overridespecifier makes it explicit that a derived function is intended to replace afunction.Hint
This base-class function supports runtime dispatch.
Answer
virtual
- 45The three main C++ access levels discussed for class members are public, protected, and_____.
Hint
This access level restricts direct access from outside the class.
Answer
private
- 46Making data_____
protectedcan make it harder to preserve an object'sbecause derived classes can modify that data.Hint
This is a condition the class relies on remaining true.
Answer
invariant
- 47Virtual calls can be costly in performance-sensitive code partly because they can inhibit_____.
Hint
This optimization replaces a function call with its body at the call site.
Answer
inlining
- 48The claim that good programming always means using large object-oriented class hierarchies is_____.
Hint
The lecture warns that object-oriented programming is not the only way to write good code.
Answer
wrong
- 49Templates let programmers parameterize types and_____so reusable code can work with different inputs.
Hint
The same operation, such as sorting, can be applied to different element types.
Answer
algorithms
- 50When a template argument's type can be inferred from the argument passed to a function, the compiler performs type_____.
Hint
The programmer does not need to spell out the type in that call.
Answer
deduction
- 51Template code that accepts a type based on whether it supports the operations used by the code follows the idea of_____typing.
Hint
The saying is that if something behaves like a particular animal, it can be treated as one.
Answer
duck
- 52A traditional template may produce confusing errors when its argument type fails to support a required_____.
Hint
For example, sorting may require that elements can be compared.
Answer
operation
- 53Template code is checked during compilation, so many type or operation errors can be caught before the program is_____.
Hint
This occurs before users receive the program.
Answer
shipped
- 54A function object can hold_____that an algorithm uses when applying the function.
Hint
Unlike a plain function, this object can retain information such as a comparison value.
Answer
state
- 55A lambda expression provides a concise way to write an inline_____for use with an algorithm.
Hint
It can stand in for a small callable object, such as a comparison rule.
Answer
function object
- 56An iterator pair can represent only part of a sequence, allowing an algorithm to work on a_____.
Hint
The selected range may be smaller than the entire container.
Answer
subsequence
- 57A generic algorithm can use an element's_____instead of requiring a particular concrete container type.
Hint
This lets one algorithm work with different containers holding the same kind of values.
Answer
type
- 58The STL's generic approach separates algorithms from the_____that provide their input ranges.
Hint
Vectors and other structures store the elements an algorithm processes.
Answer
containers
- 59In generic programming, a container's elements may need to be_____so algorithms can rearrange them.
Hint
Sorting often changes the positions of values rather than creating an entirely new container.
Answer
swappable
- 60The lecture describes generic programming as ordinary_____applied to types and operations selected at compile time.
Hint
The point is that it does not require an entirely separate way of thinking.
Answer
programming
- 61A concept states the requirements a template places on its_____.
Hint
These are the types or values supplied when the template is used.
Answer
arguments
- 62A sorting algorithm that requires direct access to arbitrary positions needs a_____access range.
Hint
This iterator capability supports jumping to an indexed position rather than advancing one step at a time.
Answer
random
- 63The standard sort algorithm cannot use a linked list's ordinary iterators because they are not_____access iterators.
Hint
The missing capability is jumping directly to an arbitrary element.
Answer
random
- 64A sorting requirement may include that elements can be compared using an ordering such as_____than.
Hint
This is the default ordering relation commonly used by sorting.
Answer
less
- 65When an algorithm searches a range and finds no match, it commonly returns the range's_____iterator.
Hint
This iterator marks the position just beyond the searched range.
Answer
end
- 66Concepts can improve template diagnostics by identifying which stated_____a type fails to meet.
Hint
This is a requirement that must hold for a template argument.
Answer
constraint
- 67A concept for sorting can express requirements such as iterator access and an element_____.
Hint
The algorithm needs to know what kind of values it is sorting.
Answer
type
- 68The lecture argues that concepts make template_____explicit instead of leaving them implicit in the code.
Hint
These describe what a template needs its arguments to provide.
Answer
requirements
- 69Generic code that uses a container parameter and a lambda can still perform runtime_____through a class hierarchy.
Hint
The example draws objects through a shared shape interface.
Answer
polymorphism
- 70The lecture recommends choosing programming techniques for the problem rather than arguing over programming_____.
Hint
These include styles such as object-oriented, generic, and functional programming.
Answer
paradigms
- 71Using a vector with its size available can reduce errors associated with C arrays losing their_____.
Hint
This property tells a program how many elements the array or container holds.
Answer
size
- 72Using containers and their size can help prevent out-of-bounds_____.
Hint
This occurs when code refers to an element beyond the valid range.
Answer
access
- 73A unique pointer can provide automatic cleanup without the shared ownership bookkeeping of a_____pointer.
Hint
This pointer type tracks multiple owners.
Answer
shared
- 74Garbage collection can interfere with predictable timing because it may require a collection_____.
Hint
Processors may have to wait while the collector performs work.
Answer
pause
- 75In hard real-time engine controls, an operation with an unpredictable execution time may be_____.
Hint
Such an operation may violate the system's timing guarantees.
Answer
disallowed
- 76C++ aims to make code readable by both humans and_____.
Hint
The lecture's design goal names these alongside human readers.
Answer
machines
- 77A static analyzer can help find defects in a large codebase without waiting for them to appear during_____.
Hint
This is when the program is running.
Answer
execution
- 78Code transformation can help_____older code into safer or more modern styles.
Hint
This means updating existing code to use newer practices.
Answer
modernize
- 79The speaker identifies performance as one reason programmers use compile-time techniques instead of postponing work until_____.
Hint
This is when the program is executing.
Answer
runtime
- 80Hardware support for range checking could help enforce bounds safety when code accesses an_____.
Hint
This is a low-level sequence whose valid index range can be exceeded.
Answer
array
- 81C++ code can use arrays close to the hardware while relying on higher-level containers for most ordinary_____.
Hint
The lecture recommends reserving direct array use for low-level cases.
Answer
work
- 82A pointer to_____
constcan allow concurrent tasks to observe data without granting them permission toit.Hint
The data remains readable but is not changed through that pointer.
Answer
modify
- 83C++ modules are intended in part to avoid repeatedly processing the same_____files across many source files.
Hint
Traditional C++ source often includes these declarations from other files.
Answer
header
- 84Repeatedly compiling the contents of included headers across many source files can increase compile_____.
Hint
This is the duration programmers wait for compilation to finish.
Answer
times
- 85C++ compiler vendors often prioritize compatibility with their own previous compiler versions because customers depend on existing_____.
Hint
This is the large body of software that users already have.
Answer
code
- 86The binary interface and name-linking conventions used by different C++ compilers are not universally_____.
Hint
The problem is that compilers may not agree on a common convention.
Answer
standardized
- 87One barrier to adopting newer C++ standards is that large organizations may need their code to compile with older_____.
Hint
These tools may not support newer language features.
Answer
compilers
- 88The lecture argues that modern C++ styles can be both safer and capable of generating_____code.
Hint
This describes improved execution speed.
Answer
faster
- 89A new programming language may struggle to succeed if it cannot join the existing C++ community and_____.
Hint
This includes the established tools, libraries, and ecosystem around a language.
Answer
infrastructure
- 90C++ is not intended to be the simplest language for every domain, such as simple_____applications.
Hint
This domain commonly refers to software that runs through browsers or web services.
Answer
web
- 91The speaker recommends teaching good modern practices rather than beginning and ending with outdated_____styles.
Hint
These are ways of writing programs that may persist in old codebases.
Answer
coding
- 92The C++ community may retain an unsafe old feature because preserving existing_____is considered more important than breaking them.
Hint
These programs may depend on long-standing language behavior.
Answer
code

Ask anything
We've read this whole study set, so questions about it get the best answers.