← Dashboard

Daily Learning Quiz — June 18, 2026

Completed Jun 19, 2026

expert MCQ 20/30 · 67%

Short answers

1.

In the context of SLAM, explain the loop closure problem and describe two different strategies to detect and handle loop closures in a graph-based SLAM system. What are the key trade-offs between these strategies?

Your answer

Loop closure is allowing the robot to recognize a location it has scanned previously to understand and correct its current drift. In vision, if we detect an image that is close to what the robot has seen before, we can extract visual features and store the current pose positions in graph. In sensor, if our current pose is close to a previous pose, we can compare current scan with previous scan and accept it as a loop closure.

Model ideal answer

The loop closure problem arises when a robot revisits a previously mapped area, and the accumulated drift in the trajectory must be corrected by recognizing the revisit and optimizing the graph. Two common detection strategies are: (1) Bag-of-Visual-Words (BoW) using feature descriptors and a vocabulary tree to perform place recognition, and (2) scan matching (e.g., ICP) on LIDAR data combined with a short-term pose estimate to identify geometric similarity. Once detected, handling involves adding a constraint (edge) in the pose graph and running a global optimization (e.g., using g2o or Ceres). Trade-offs: BoW is robust to viewpoint change and works well in appearance-based scenarios, but can produce false positives in environments with repeated structure; it also requires a pre-trained vocabulary. Scan matching is more accurate for geometric integrity, but is computationally heavier per candidate and may fail under large viewpoint differences. Additionally, false positive handling requires techniques like verification with RANSAC or temporal consistency checks.

2.

The double descent phenomenon in modern machine learning contradicts the classical bias-variance tradeoff. Describe double descent and explain why it occurs in overparameterized models. How does this phenomenon relate to the notion of 'benign overfitting'?

Your answer

The classical bias-variance tradeoff is when you need to balance between bias and variance, where a simple model has low variance, high bias and may cause underfitting. On the other hand, a more complicated model has high variance, low bias, causing overfitting. However, in an overparameterized model, with the complex network it is able to learn multiple ways to overfit the training data, making it back able to generalize well for test examples.

Model ideal answer

Double descent refers to the observation that as model complexity (e.g., number of parameters) increases, test error first descends, then ascends (like the traditional bias-variance tradeoff), but then descends again when the model becomes highly overparameterized. This occurs because in the overparameterized regime, the model can interpolate the training data perfectly while still maintaining good generalization due to implicit regularization from the optimization algorithm (e.g., SGD converges to a minimum-norm solution). Benign overfitting is a related concept where a model fits noisy training data exactly but still generalizes well; it happens when the noise is 'benign' (e.g., concentrated in low-variance directions). The double descent phenomenon is a manifestation of benign overfitting: the test error peaks near the interpolation threshold where the model just barely fits the data (a critical regime), but then decreases as the model becomes even more overparameterized, allowing it to fit the noise without harming generalization.

3.

In reinforcement learning, the 'deadly triad' refers to the instability that arises when combining function approximation, bootstrapping, and off-policy learning. Explain why each component is necessary for the instability, and describe a practical algorithm (e.g., DQN) that mitigates this instability. What specific techniques does DQN use to address the triad?

Your answer

Approximation is used so we can estimate the reward instead of calculating / simulating entire trajectory, needed for practical computational ability. Bootstrapping is only using a small set of future state's reward to determine current reward instead of accounting for the entire rest of trajectory, as that is higher variance and less predictable. Off-policy learning can give better exploration. DQN can, for example, create two networks, and only updating the slower policy network after the fast policy network updates more frequently to reduce variance.

Model ideal answer

The deadly triad is a set of three components that can cause value function divergence: (1) function approximation (e.g., neural networks) leads to generalization and potential interference; (2) bootstrapping (updating estimates from other estimates) introduces bias and can propagate errors; (3) off-policy learning (learning from data not generated by the current policy) increases variance due to differing state-action distributions. When combined, the approximation error can be amplified, leading to unbounded estimates. DQN mitigates this by using two key techniques: a target network (reducing bootstrapping by fixing the target for a number of steps) and experience replay (which breaks temporal correlations and stabilizes updates, but still off-policy). These techniques reduce the interaction between the components, particularly by reducing the severity of bootstrapping and off-policy instability through slower updates and more i.i.d. data.

4.

Denoising diffusion probabilistic models (DDPMs) can be interpreted as learning the score function of the data distribution. Show mathematically how the training objective of DDPMs (simplified MSE on noise) is equivalent to score matching. What is the connection to Langevin dynamics?

Your answer

I don't know. Can you explain this answer to me?

Model ideal answer

In DDPMs, the forward process adds noise to data: x_t = sqrt(1-beta_t) x_{t-1} + sqrt(beta_t) epsilon. The reverse process is parameterized as p_theta(x_{t-1}|x_t) = N(x_{t-1}; mu_theta(x_t, t), sigma_t^2 I). The training objective is to predict the added noise epsilon: E_{t,x_0,epsilon}[ ||epsilon - epsilon_theta(x_t, t)||^2]. With Tweedie's formula, the optimal denoiser relates to the score: grad_{x_t} log q(x_t) = - (1/sqrt(1-bar_alpha_t)) E[epsilon | x_t]. Hence, minimizing the noise prediction MSE is equivalent to score matching: E[ ||grad_{x_t} log q(x_t) - s_theta(x_t, t)||^2] up to a scaling factor. The sampling process (starting from pure noise and iteratively denoising) corresponds to Langevin dynamics, where each step is a gradient ascent in the data log-density plus added noise, approximating sampling from the data distribution. The connection is that the reverse diffusion process is essentially performing annealed Langevin dynamics with the learned score.

5.

In ROS2, the executor is responsible for scheduling and executing callbacks. Compare the SingleThreadedExecutor with the MultiThreadedExecutor. Under what circumstances would you choose a StaticSingleThreadedExecutor, and what are the trade-offs regarding priority inversion and spin callbacks?

Your answer

SingleThreadedExecutor has lass room for error, waits for one thread to finish before moving onto the next. Drawback is each thread is waiting for previous threads to complete, could be slower. Multi is just having multiple threads active at once, more prone to concurrency related errors, but could be faster, for example lidar, imu, camera can report their sensor values back concurrently instead of waiting for each other to finish first.

Model ideal answer

The SingleThreadedExecutor runs all callbacks sequentially in one thread, ensuring no concurrency issues but limited throughput. The MultiThreadedExecutor uses a thread pool to execute callbacks concurrently, potentially improving performance for CPU-bound or I/O-bound tasks but introducing data race risks. The StaticSingleThreadedExecutor assigns each callback to a specific executor entity (e.g., a node) and does not support dynamic addition of nodes; it yields lower overhead because it avoids callback group arbitration. A key trade-off: in the standard SingleThreadedExecutor, if a callback takes a long time, it blocks others (priority inversion possible if high-priority callbacks are queued). StaticSingleThreadedExecutor can mitigate this by separating callbacks into different executors, but requires careful configuration. Spin callbacks (e.g., timer callbacks) can cause deadlocks if they are interdependent and executed by different threads; the multi-threaded executor is more susceptible to such issues without proper synchronization.

6.

In embedded systems with limited memory, dynamic memory allocation (e.g., malloc/free or new/delete) is often discouraged. Explain the specific reasons why dynamic allocation can be problematic in such systems. Under what circumstances might a static allocation strategy be insufficient, and how can a memory pool allocator be used to bridge the gap?

Your answer

There is much less memoy on an embedded system, so when it ran into OOM problems, it is much more likely to crash and fail compared to a computer with more memory to prevent entire system crashing. Static memory may be insufficient if we don't know the exact amount of messages that will come back, so setting it to a higher bound array is wasting space. A memory pool allocator allocates a fixed block of memory during start up, then divides it into fixed-size chunks to be used.

Model ideal answer

Dynamic allocation is problematic because: (1) heap fragmentation can cause allocation failures even if total free memory is sufficient; (2) allocation and deallocation times are unbounded, breaking real-time guarantees; (3) memory leaks are hard to debug; (4) overhead due to tracking allocations. Static allocation (all sizes known at compile time) avoids these issues but is inflexible for variable-sized data or runtime configurable buffers. A memory pool allocator pre-allocates a fixed-size block or multiple fixed-size slots (e.g., slab allocator) and hands them out in constant time, reducing fragmentation (no external fragmentation for same-size blocks) and providing deterministic runtime. This works well for objects of known, bounded size that need to be created dynamically (e.g., message buffers in a communication stack).

7.

Explain the MESI cache coherence protocol. Under what conditions does a cache line in the 'Shared' state transition to 'Modified'? What is the role of the 'Invalid' state in ensuring correctness, and how does a write miss handled in a write-back cache differ from that in a write-through cache?

Your answer

I don't know this one. Can you explain to me.

Model ideal answer

MESI has four states: Modified, Exclusive, Shared, Invalid. A line in Shared can transition to Modified only if the core performs a write and it has exclusive access; the core must invalidate all other copies by sending an invalidate message on the bus. The 'Invalid' state marks a line as not present or stale; it is crucial because it ensures that before a core reads a line, it gets the most recent data from another cache or memory, preventing stale reads. In a write-back cache, a write miss (line not in cache or in Invalid) first fetches the line (read-for-ownership), modifies it, marks it Modified, and writes to memory only when evicted. In a write-through cache, a write miss typically allocates a line in the cache (or not, depending on policy) and immediately writes through to memory; this simplifies coherence because memory is always up-to-date but increases bus traffic.

8.

Consider the following C++ code snippet. Identify all issues related to memory management, move semantics, and ownership. Propose fixes using modern C++ features (C++11 and later).

class Buffer {
public:
    Buffer(size_t size) : data(new int[size]), size_(size) {}
    ~Buffer() { delete[] data; }
    int* data;
    size_t size_;
};

Buffer createBuffer() {
    Buffer b(100);
    return b; // (A)
}

int main() {
    Buffer b1 = createBuffer();
    Buffer b2 = b1; // (B)
    b2.data[0] = 42;
}
Coding

Your answer

I don't know. Can you explain.

Model ideal answer

Issues: (1) No copy constructor or copy assignment operator defined, leading to shallow copies (double deletion). (2) No move constructor/assignment, so returning from createBuffer may copy (if RVO not applied) causing same issue. (3) The class has a raw pointer but no rule-of-five adherence. (4) In main, b2 = b1 results in two objects pointing to the same data, and both will attempt to delete it in destructor — undefined behavior. Fixes: Implement copy constructor (deep copy), copy assignment (copy-swap idiom), move constructor and move assignment (stealing the resource and setting other's data to nullptr), or better, use std::vector instead of raw array. Also, provide a destructor as already done. Using std::vector automatically handles correct copying and moving. If the raw pointer is needed, follow the rule-of-five. Additionally, the return statement (A) should invoke move semantics if a move constructor is available; if not, it relies on RVO or copy. To be safe, define move operations or use std::move explicitly (though not needed due to implicit move from local variable in return).

9.

You are debugging a multi-threaded application that deadlocks. The code uses two mutexes: mutexA and mutexB. Thread 1 locks mutexA then mutexB; Thread 2 locks mutexB then mutexA. A colleague suggests using std::lock() to lock both mutexes simultaneously. Write a C++ snippet demonstrating the correct usage and explain why it prevents deadlock. Additionally, describe a scenario where even using std::lock() could still result in deadlock (if any) or other issues.

Coding

Your answer

If they are executed at the same time, there could be the case where thread 1 locks mutex A, thread 2 locks mutex B, then thread 1 can't get to mutexB and thread 2 can't use thread A. Can you show me how to use the C++ correctly? Maybe add a synchronization to it to prevent it?

Model ideal answer

Correct usage:

std::mutex mutexA, mutexB;

void thread1() {
    std::lock(mutexA, mutexB);
    std::lock_guard<std::mutex> lock1(mutexA, std::adopt_lock);
    std::lock_guard<std::mutex> lock2(mutexB, std::adopt_lock);
    // work
}

void thread2() {
    std::lock(mutexA, mutexB);
    std::lock_guard<std::mutex> lock1(mutexA, std::adopt_lock);
    std::lock_guard<std::mutex> lock2(mutexB, std::adopt_lock);
    // work
}

std::lock() uses a deadlock-avoidance algorithm (e.g., back-off) to lock the mutexes without deadlock if possible. It prevents the classic deadlock because it ensures that the two mutexes are locked atomically (or at least without interleaving that causes circular wait). However, a scenario where deadlock could still occur: if the code has multiple lock requests spread across functions or conditional locking, or if there is a third mutex not managed by the same std::lock call. Also, if threads use try_lock() incorrectly, or if resources are locked in a recursive manner without proper ordering. Moreover, std::lock does not protect against deadlocks that involve other synchronization primitives (e.g., condition variables) or if the locking order is not consistent across all code paths (at least across all callers of this function, but here both threads use the same order so it's fine). Another issue: if the threads try to lock in a different order elsewhere, deadlock may still occur.

10.

In finance, the Black-Scholes model assumes constant volatility and no dividends. Explain the concept of the volatility smile and why it suggests that the Black-Scholes model is an incomplete description of market behavior. How does the implied volatility surface incorporate market data, and what role does it play in pricing exotic options?

Your answer

I don't know this one.

Model ideal answer

The volatility smile is the pattern where, for a fixed maturity, implied volatilities of options plotted against strike prices form a 'smile' shape—higher for deep in/out-of-the-money options and lower for at-the-money. This contradicts Black-Scholes' assumption of constant volatility, suggesting that market participants expect future volatility to vary with moneyness and time. Reasons include leptokurtic distributions (fat tails) and leverage effects. The implied volatility surface extends this to different maturities, creating a 3D surface (strike vs. time). It is used to calibrate stochastic volatility models (e.g., Heston) or local volatility models (e.g., Dupire) that better match market prices. For exotic options (e.g., barriers, Asian options), the volatility surface is critical because these options have path-dependent payoffs; a simple Black-Scholes model misprices them significantly. Traders use the surface to compute the cost of hedging and to quote consistent prices.

Multiple-choice review

1.

In the context of simultaneous localization and mapping (SLAM), which of the following best describes the primary challenge of 'loop closure'?

Correct
A Detecting when the robot returns to a previously visited location and correcting accumulated drift. Correct answer
B Ensuring the robot does not revisit the same location more than once to avoid redundant mapping.
C Closing the control loop between sensor measurements and actuator commands in real-time.
D Fusing data from multiple sensors to create a single consistent map of the environment.
Why: Loop closure is the problem of recognizing when a robot returns to a previously mapped area and then using that information to correct the drift that has accumulated in the robot's pose estimate. Option B is incorrect because revisiting is common and useful. Option C refers to control, not mapping. Option D describes sensor fusion, not specifically loop closure.
2.

In a Transformer-based language model, which of the following is a key property of the attention mechanism that makes it more computationally expensive than recurrence for long sequences?

Correct
A Attention computes pairwise interactions between all positions, leading to O(n^2) complexity in sequence length. Correct answer
B Attention requires storing hidden states for each time step, leading to O(n) memory.
C Attention uses a fixed-size context window, limiting its ability to model long-range dependencies.
D Attention relies on a recurrent update rule that scales linearly with sequence length.
Why: The self-attention mechanism in Transformers computes attention scores for every pair of positions, resulting in O(n^2) time and memory complexity for a sequence of length n. Option B is true of RNNs, not Transformers. Option C is false; attention can model long-range dependencies. Option D describes recurrent networks.
3.

In reinforcement learning, the policy gradient theorem provides the gradient of the expected return with respect to policy parameters. Which of the following is a correct expression for the gradient in the case of a stochastic policy π_θ(a|s)?

Incorrect
A ∇_θ J(θ) = E_{s,a ~ π_θ}[∇_θ log π_θ(a|s) Q^π(s,a)] Correct answer
B ∇_θ J(θ) = E_{s ~ d^π, a ~ π_θ}[∇_θ π_θ(a|s) A^π(s,a)]
C ∇_θ J(θ) = E_{s,a ~ π_θ}[∇_θ π_θ(a|s) R(s,a)]
D ∇_θ J(θ) = E_{s ~ p_0, a ~ π_θ}[∇_θ log π_θ(a|s) V^π(s)] Your answer
Why: The policy gradient theorem states ∇_θ J(θ) = E[∇_θ log π_θ(a|s) Q^π(s,a)], where the expectation is over states and actions from the on-policy distribution. Option B uses the advantage function, but with π_θ instead of log π_θ, which is incorrect. Option C uses the raw gradient of π_θ and R instead of Q. Option D uses V^π and initial state distribution, which is not the standard form.
4.

In diffusion models, the reverse process is typically parameterized as a denoising function that predicts the noise component of a noisy sample. Which of the following is a correct interpretation of the training objective for a continuous-time diffusion model?

Correct
A Minimizing the mean squared error between the predicted noise and the actual noise added to the data, weighted by a schedule-dependent factor.
B Maximizing the likelihood of the data under the reverse process by directly optimizing the ELBO, which simplifies to a denoising score matching objective.
C Minimizing the KL divergence between the forward and reverse processes at each time step, which requires computing the exact score function.
D Both A and B are correct; the objective is equivalent to minimizing the MSE between predicted and actual noise, and this also maximizes an ELBO. Correct answer
Why: In diffusion models, the training objective is typically a weighted MSE between the predicted noise and the actual noise added (as in DDPM). This objective can be derived from a variational lower bound (ELBO) on the data likelihood, making it equivalent to maximizing an ELBO. Option A is correct, but B is also correct because the denoising score matching objective is derived from the ELBO. Option C is incorrect; the KL divergence is used in the derivation but the objective simplifies to denoising score matching.
5.

In machine learning, which of the following best describes the bias-variance decomposition of expected squared error?

Correct
A The expected test error can be decomposed into the square of bias plus variance plus irreducible error.
B Bias decreases with model complexity, while variance increases, leading to a U-shaped risk curve.
C The decomposition applies only to regression problems with squared loss and assumes the model is unbiased.
D Both A and B are correct and are consequences of the bias-variance tradeoff. Correct answer
Why: The bias-variance decomposition states that the expected squared error = (bias)^2 + variance + irreducible error. As model complexity increases, bias tends to decrease and variance tends to increase, producing a U-shaped generalization error curve. Option C is incorrect because it does not require the model to be unbiased; the decomposition always holds for squared loss. Therefore, both A and B are correct.
6.

In ROS2, which of the following best describes the role of the rmw (ROS Middleware) layer?

Correct
A It provides an abstraction layer over different DDS implementations, allowing ROS2 to be portable across middleware vendors. Correct answer
B It implements the ROS2 client library's API for C++ and Python, hiding the underlying transport.
C It handles intra-process communication using shared memory without going through DDS.
D It manages the lifecycle of nodes and parameters, similar to a node manager in ROS1.
Why: The rmw (ROS Middleware) layer is an abstraction interface that allows ROS2 to work with different DDS implementations (e.g., Fast DDS, Cyclone DDS, Connext). Option B describes the rcl layer (ROS Client Library). Option C is intra-process communication, not rmw. Option D describes node and parameter management, which is handled by rcl and the node class.
7.

In embedded systems, which of the following best describes a primary advantage of using a real-time operating system (RTOS) over a bare-metal scheduler?

Incorrect
A An RTOS provides deterministic scheduling guarantees for critical tasks through priority-based preemption. Correct answer
B An RTOS eliminates the need for interrupts, simplifying hardware design.
C An RTOS reduces memory footprint compared to a bare-metal system by using static task allocation.
D An RTOS allows for dynamic loading of tasks at runtime, which bare-metal systems cannot support. Your answer
Why: An RTOS provides deterministic scheduling, typically through priority-based preemptive scheduling, ensuring that high-priority tasks meet their deadlines. Option B is false; RTOS often relies on interrupts. Option C is false; RTOS usually adds overhead. Option D is not a primary advantage; real-time systems often use static task sets.
8.

In computer science, which of the following statements about the halting problem is true?

Incorrect
A It is undecidable for all Turing machines, meaning no algorithm can determine whether an arbitrary program halts. Your answer
B It is decidable for programs that do not contain loops.
C It is decidable for finite-state machines and pushdown automata.
D It is semi-decidable, meaning there exists an algorithm that always halts and says 'yes' if the program halts, but may loop if it does not. Correct answer
Why: The halting problem is undecidable, meaning no algorithm can correctly decide for all inputs. However, it is semi-decidable (recognizable): we can simulate the program and if it halts, we know it halts; if it doesn't, we might loop forever. Option A is partially correct but misses the nuance of semi-decidability. Option B is false; even with loops, but loops can be unbounded. Option C is false; for pushdown automata, it is decidable, but the question asks generally.
9.

In C++, which of the following is true about the use of std::move?

Incorrect
A It converts an lvalue to an rvalue reference, enabling move semantics, but does not actually move anything; it merely casts. Your answer
B It transfers ownership of the underlying resource from the source to the destination, leaving the source in a valid but unspecified state.
C It is equivalent to calling the move constructor or move assignment operator, and must be used with caution to avoid undefined behavior.
D Both A and B are correct, as `std::move` is a cast that enables move operations which then transfer resources. Correct answer
Why: `std::move` is essentially a cast to an rvalue reference, which then allows move constructors/assignments to be called. Those operations transfer resources, leaving the source in a valid but unspecified state. Option A correctly describes the cast nature, and B describes the effect when move operations are invoked. Option C is partially right but conflates the cast with the move operation. So both A and B are true, making D correct.
10.

In memory management, which of the following is a potential advantage of using a buddy allocator over a slab allocator?

Incorrect
A Buddy allocators eliminate external fragmentation completely through coalescing.
B Buddy allocators provide very fast allocation and deallocation for fixed-size objects.
C Buddy allocators minimize internal fragmentation by using powers-of-two block sizes. Your answer
D Buddy allocators are simpler to implement and have lower overhead than slab allocators for general-purpose allocation. Correct answer
Why: Buddy allocators are relatively simple to implement and have low overhead, making them suitable for general-purpose kernel memory allocation. They do not eliminate external fragmentation (coalescing helps but doesn't eliminate it). They are not optimized for fixed-size objects; slab allocators are better for that. They often suffer from internal fragmentation due to powers-of-two sizes. Option D is the most accurate advantage.
11.

In concurrency, which of the following describes a scenario where a deadlock is possible?

Correct
A Two threads each hold one resource and wait for the resource held by the other, forming a circular wait.
B A thread holding a lock attempts to acquire the same lock again (recursive locking) without using a recursive mutex.
C A thread holds a lock and then tries to acquire another lock that is already held by a third thread that is waiting for a lock held by the first thread.
D All of the above are potential deadlock scenarios. Correct answer
Why: All scenarios describe potential deadlocks. A is classic circular wait. B is a self-deadlock if the mutex is non-recursive. C describes a wait-for cycle involving multiple threads. Thus D is correct.
12.

In multithreaded programming, which of the following is true about the difference between a mutex and a semaphore?

Correct
A A mutex can be used to synchronize access to a shared resource, while a semaphore can also be used to signal events between threads.
B A mutex is owned by the thread that locks it, and only that thread can unlock it, whereas a semaphore can be unlocked by any thread.
C A mutex has a counter that can be incremented or decremented, whereas a semaphore is a binary lock.
D Both A and B are correct. Correct answer
Why: Mutual exclusion (mutex) is typically owned by the locking thread and must be unlocked by the same thread (for regular mutexes). Semaphores can be used for signaling and the V operation can be called from any thread. Option A is also true: mutexes protect critical sections, semaphores can coordinate. Option C is backwards: semaphores have a counter, mutexes often are binary. So both A and B are correct.
13.

In concurrency, what is the purpose of a memory barrier (fence)?

Correct
A It prevents the CPU and compiler from reordering loads and stores across the barrier, ensuring visibility of shared data. Correct answer
B It ensures that all threads have a consistent view of memory, eliminating the need for locks.
C It flushes the CPU cache, forcing all writes to main memory immediately.
D It synchronizes the clocks of multiple cores to avoid race conditions.
Why: Memory barriers (fences) enforce ordering constraints on memory operations, preventing certain types of reordering by the compiler or CPU. This ensures that other threads observe memory modifications in the intended order. Option B is false; barriers do not eliminate locks. Option C is an oversimplification; they don't necessarily flush caches. Option D is false; they don't synchronize clocks.
14.

In finance, what is the primary risk associated with an inverse floater bond?

Correct
A As interest rates rise, the coupon payments decrease, leading to price depreciation. Correct answer
B As interest rates fall, the coupon payments can become negative, causing losses.
C The bond's principal is highly leveraged, exposing investors to default risk.
D The bond's duration is negative, meaning its price moves in the same direction as interest rates.
Why: An inverse floater has a coupon that moves opposite to a reference rate. When interest rates rise, the coupon falls, and the bond price typically declines due to higher discount rates. Option B is incorrect because coupons are usually floored at zero. Option C: inverse floaters may have leverage but that's not the primary risk. Option D: duration is positive but large, not negative.
15.

Which of the following factors is considered a primary cause of the collapse of the Roman Republic?

Correct
A The increasing concentration of wealth and land among a few elites, leading to social unrest and the decline of the small farmer-soldier class. Correct answer
B The adoption of Christianity as the state religion, which undermined traditional Roman values.
C The invasion of Germanic tribes that overwhelmed the Roman legions in the 2nd century BC.
D The establishment of a permanent navy that drained the treasury and led to inflation.
Why: The collapse of the Roman Republic is often attributed to economic inequality, the rise of latifundia, and the decline of the yeoman farmer class, which led to military loyalties shifting from the state to generals. Option B is associated with the later Empire, not the Republic. Option C: Germanic invasions were significant in the later Empire, not the Republic. Option D is not a primary cause.
16.

In robotics, the concept of 'differential flatness' is particularly useful for controlling which type of system?

Correct
A Underactuated systems with nonholonomic constraints Correct answer
B Fully actuated systems with holonomic constraints
C Systems with redundant degrees of freedom
D Linear time-invariant systems
Why: Differential flatness allows nonlinear control to be reduced to linear control via flat outputs, which is especially powerful for underactuated systems like quadrotors and car-like robots that have nonholonomic constraints. Fully actuated and holonomic systems are simpler and do not require such methods; redundant systems are not the primary use case; and linear systems are already tractable.
17.

In the context of neural network training, the 'double descent' phenomenon refers to:

Correct
A The test error decreasing twice as the model complexity increases, once after interpolation threshold
B The test error first decreasing, then increasing, then decreasing again as model size grows Correct answer
C The training loss having two minima as a function of learning rate
D The gradient norm decreasing then increasing during training
Why: Double descent describes the phenomenon where test error initially decreases, then increases around the interpolation threshold (where the model exactly fits the training data), and then decreases again with further overparameterization, contradicting the classic bias-variance trade-off. The other options describe unrelated observations.
18.

In distributional reinforcement learning, the categorical algorithm (C51) represents the value distribution as a set of discrete atoms. A key challenge is:

Correct
A The projection step that maps predicted distributions onto the fixed support introduces bias Correct answer
B The atoms must be learned via gradient descent
C The number of atoms must be exponentially large for high-dimensional state spaces
D The algorithm cannot handle stochastic environments
Why: C51 uses a fixed support of atoms; after a Bellman update, the resulting distribution is projected onto this support, which introduces an unavoidable bias. The atoms are fixed, not learned; the number of atoms is linear, not exponential; and the algorithm handles stochastic environments naturally.
19.

In diffusion models, the use of the 'score function' (∇_x log p(x)) is central to generation. One advantage of score-based modeling over directly modeling the density is:

Correct
A The score function is always defined even for distributions supported on low-dimensional manifolds
B The score function can be estimated via denoising score matching without knowing the partition function Correct answer
C The score function yields a deterministic generative process
D The score function is easier to compute for high-dimensional Gaussian mixtures
Why: Score matching avoids the intractable partition function by learning the gradient of the log-density directly. Option A is false because the score is not defined on low-dimensional manifolds (gradient does not exist). Option C is false because diffusion models are inherently stochastic (though reverse process becomes deterministic in probability flow ODE). Option D is not a general advantage.
20.

In high-dimensional linear regression, the 'curse of dimensionality' manifests in the phenomenon that the k-nearest neighbors algorithm's effective distance metric becomes:

Incorrect
A Insensitive to relevant features due to the concentration of distances Correct answer
B Unbounded as dimensionality increases
C Equivalent to the Euclidean distance only for large k Your answer
D Robust due to the law of large numbers
Why: In high dimensions, distances between points tend to become nearly equal (concentration of distances), making k-NN less able to distinguish between neighbors. This is the concentration of measure phenomenon. Distances are not unbounded; they converge with normalization. Equivalence to Euclidean is not affected by k. The law of large numbers does not help.
21.

In ROS2, which of the following is the primary mechanism to achieve zero-copy data transfer between nodes?

Incorrect
A Using shared memory via the Intra-Process communication (Intra-Process) API
B Designing nodes within the same process using node composition Correct answer
C Utilizing the DDS protocol's built-in zero-copy feature Your answer
D Passing data via const references in callback signatures
Why: Node composition (loading nodes into a single process) allows them to share memory directly, enabling zero-copy. The Intra-Process API is deprecated and does not guarantee zero-copy. DDS zero-copy is not standard across implementations, and const references are about API design, not data transfer.
22.

In embedded systems, a 'watchdog timer' that is configured to generate a reset upon timeout is most effective when:

Correct
A It is serviced (kicked) at irregular intervals to detect unpredictable hangs
B It uses a separate clock source from the CPU to avoid failure correlation Correct answer
C It is disabled during critical code sections to prevent false resets
D It is implemented in software to minimize hardware cost
Why: A separate clock source ensures that if the CPU clock fails (e.g., due to a hardware fault), the watchdog continues to run, making it effective at detecting failures. Irregular servicing increases the risk of a spurious timeout. Disabling the watchdog for safety-critical sections defeats its purpose. A software watchdog is inherently unreliable because it shares the same failure modes as the software it monitors.
23.

The Cook-Levin theorem establishes that the Boolean satisfiability problem (SAT) is NP-complete. Which of the following is a direct corollary of this result?

Incorrect
A If SAT can be solved in polynomial time, then P = NP
B SAT is the hardest problem in NP
C There exists a polynomial-time reduction from the traveling salesman problem (TSP) to SAT Your answer
D Every problem in NP can be reduced to SAT in polynomial time Correct answer
Why: The theorem directly proves that any NP problem can be reduced to SAT in polynomial time, which is the definition of NP-hardness. Option A is a consequence but not the direct output of the theorem; it follows from the reduction. Option B is vague; 'hardest' is informal. Option C is true but not a direct corollary; it relies on TSP being NP-complete.
24.

In C++, which of the following statements about the 'rule of five' (or rule of three/zero) is correct?

Incorrect
A If a class defines any of the special member functions (destructor, copy constructor, copy assignment, move constructor, move assignment), it should define all five Your answer
B The rule of five is mandatory for classes that manage a raw resource
C If a class does not need a custom destructor, it should not define any of the other special members (rule of zero) Correct answer
D Defining a custom copy constructor without a custom destructor leads to undefined behavior
Why: The rule of zero advocates that if a class does not manage resources, it should use the default special members generated by the compiler. Option A is too strict; the rule of five applies when a class manages resources, but not all five are always needed. Option B: it's not mandatory; the compiler defaults may suffice. Option D is false; undefined behavior occurs only if there is improper management.
25.

In virtual memory systems, 'thrashing' specifically refers to:

Correct
A A situation where the system spends a significant portion of time handling page faults rather than executing user processes Correct answer
B The condition when the page table is too large to fit in memory
C The rapid fluctuation of the page fault rate due to the choice of page replacement algorithm
D The phenomenon where increasing multiprogramming level leads to decreased CPU utilization
Why: Thrashing is defined as excessive paging activity that causes the CPU to be busy swapping pages instead of executing processes. Option D describes a related effect but is not the definition; it is a consequence. Option B is not thrashing; option C is not a standard definition.
26.

In the context of deadlock detection, which of the following best describes why it is often impractical to detect deadlocks using the 'wait-for graph' approach in a system with many resources?

Correct
A The wait-for graph can become exponentially large
B Cycles in the wait-for graph do not always imply deadlock due to multiple resource instances Correct answer
C The graph must be updated atomically, which is difficult in distributed systems
D The wait-for graph cannot detect deadlocks involving semaphores
Why: With multiple instances of a resource type, a cycle in the wait-for graph does not guarantee deadlock because some waiting threads may eventually obtain resources. Option A is false (graph size is polynomial). Option C is a practical but not the primary theoretical reason. Option D is false; semaphores can be modeled.
27.

In real-time systems, priority inversion occurs when a lower-priority thread holds a mutex needed by a higher-priority thread. Which of the following mechanisms specifically solves priority inversion?

Correct
A Priority inheritance protocol Correct answer
B Spinlock with adaptive backoff
C Recursive mutex
D Condition variable with broadcast
Why: Priority inheritance temporarily raises the priority of the lower-priority thread to that of the highest waiting thread, preventing inversion. Spinlocks do not address priority; recursive mutexes allow reentrancy but do not solve inversion; condition variables are for signaling, not priority management.
28.

In lock-free concurrent programming with compare-and-swap (CAS), the 'ABA problem' refers to:

Correct
A A situation where a value is changed from A to B and then back to A, causing a CAS to succeed incorrectly because it only checks the expected value A Correct answer
B The problem of three threads A, B, C, where A overwrites B's pointer
C The impossibility of implementing a lock-free stack due to memory reclamation
D A deadlock scenario where three mutexes are needed
Why: The ABA problem occurs when a location's value changes from A to B and back to A between a thread's read and CAS, causing the CAS to mistakenly succeed even though the state has changed. Solutions include tagged pointers or double-wide CAS. Options B, C, D are incorrect descriptions.
29.

In the Black-Scholes option pricing model, which of the following assumptions is critical for the derivation of the partial differential equation (PDE) that leads to the formula?

Incorrect
A The underlying asset's volatility is constant and known Correct answer
B The risk-free rate is a deterministic function of time
C The option can be exercised early
D The underlying asset pays continuous dividends Your answer
Why: The Black-Scholes PDE relies on the assumption of constant volatility to create a risk-free hedge; without it, the PDE would have additional terms. A deterministic risk-free rate is also assumed but can be relaxed. Early exercise applies to American options, thus not critical for the European option PDE. Dividends are not part of the original derivation.
30.

Which of the following was a significant direct consequence of the 'Plague of Athens' during the Peloponnesian War (430-426 BCE)?

Correct
A The weakening of Athens' military capacity and the death of Pericles Correct answer
B The immediate surrender of Athens to Sparta
C The establishment of the Delian League
D The rise of Macedon under Philip II
Why: The plague killed a large portion of Athens' population, including its leader Pericles, and severely weakened its military, contributing to its eventual defeat in the war, but the war continued for years. Option B is false; Athens surrendered much later. Option C predates the plague (formed in 478 BCE). Option D occurred in the 4th century BCE, long after.