Daily Learning Quiz — June 21, 2026

expert Concurrency Async, futures, thread pools, and task-based design Compare std::async, futures/promises, packaged_task, coroutines, thread pools, and work stealing at a conceptual level Oversubscription, hidden blocking, unbounded task queues, poor cancellation handlingObject Model Classes, structs, invariants, encapsulation, and constructors Design classes that preserve invariants; know explicit constructors, member initialization lists, delegating constructors, and default member initializers Two-phase initialization bugs, implicit conversions, uninitialized fields, invalid object statesDesign API design, idioms, and professional C++ style Apply const-correctness, RAII, value semantics, dependency boundaries, pImpl, noexcept where useful, minimal ownership exposure, and testable interfaces Leaky abstractions, unclear ownership, over-template APIs, inheritance where composition fits betterSelf-Supervised Learning Contrastive learning and representation learning Explain InfoNCE, positive/negative pairs, mutual-information intuition, collapse prevention, BYOL/SimSiam-style non-contrastive learning, and representation probing Shortcut augmentations, false negatives, representation collapse, high linear-probe score but poor transferNeural Nets Backpropagation and automatic differentiation Explain reverse-mode AD, computation graphs, vector-Jacobian products, stop-gradient, detach, checkpointing, and gradient accumulation Accidental graph break, double backward memory explosion, incorrect detach, gradients all-reduced or scaled twiceSequence Modeling Tokenization, embeddings, language modeling, and autoregressive training Understand BPE/SentencePiece-style tokenization, next-token prediction, teacher forcing, exposure bias, perplexity, and sequence-level evaluation Tokenization artifacts, train-inference mismatch, low perplexity but poor generation, length bias

Answer all questions, then submit once at the bottom. Correct answers, explanations, and the model's ideal short answers are revealed only after you submit.

Section 1 · Multiple choice

0/30 answered
Multiple choice question 1
1.

You have a thread pool with a fixed number of threads. Tasks are submitted to a shared queue. Each task may itself submit new tasks and wait for their completion via future::get(). What is the most likely cause of a deadlock?

Multiple choice question 2
2.

Consider a class that manages two resources and must maintain an invariant that both are either acquired or not. You provide a move constructor. Which of the following is the best practice to preserve the invariant?

Multiple choice question 3
3.

You refactor a class to use the pImpl idiom with std::unique_ptr. The implementation file fully defines Impl. The header declares class Foo { ~Foo(); ... }; but the destructor is not defined inline. What is the primary reason for requiring an explicit destructor declaration in the header?

Multiple choice question 4
4.

BYOL (Bootstrap Your Own Latent) learns representations without negative pairs. Which of the following best explains why it avoids collapse to a constant representation?

Multiple choice question 5
5.

In training a large transformer with gradient checkpointing, you notice that memory usage decreased but training time increased. What is the primary reason for the increased time?

Multiple choice question 6
6.

An autoregressive language model achieves very low perplexity on the validation set but generates gibberish or highly repetitive text during sampling. What is the most plausible explanation?

Multiple choice question 7
7.

The deadly triad in reinforcement learning is known to cause instability. Which of the following best explains the underlying mechanism?

Multiple choice question 8
8.

In an Actor-Critic setup for a continuous action space, the actor is trained to maximize the critic's output. Which of the following describes a typical failure mode due to an imperfect critic?

Multiple choice question 9
9.

A model-based RL agent trains a dynamics model to predict next states. When planning with this model, you observe that the agent achieves high cumulative reward under the model but fails on the real system. Even one-step model prediction error is low. What is the most likely issue?

Multiple choice question 10
10.

A behavioral cloning policy is trained on teleoperated demonstrations for a block-stacking task. During deployment, the robot successfully places the first block but then makes small misalignments that snowball into a failure after a few blocks. What is the primary phenomenon?

Multiple choice question 11
11.

In hierarchical whole-body control, a quadratic program (QP) solves for joint torques given prioritized tasks and constraints. A common failure mode is that the QP solver returns "infeasible". Which of the following is the most likely cause?

Multiple choice question 12
12.

You are deploying a robot arm that performs fine assembly tasks learned via imitation learning. In the lab, it succeeds 95% of the time, but on the factory floor it fails frequently. Calibration is checked and consistent. Which evaluation metric is most critical to diagnose the discrepancy?

Multiple choice question 13
13.

You have a thread pool implementation where tasks can enqueue new tasks. You observe that under heavy load, the latency of short tasks spikes unpredictably. Profiling shows that a few long-running tasks are not being preempted. What is the most likely architectural limitation?

Multiple choice question 14
14.

You are designing a library that exposes a type-erased callback interface for event handling. Users can register any callable type. To minimize compile-time coupling and maximize runtime flexibility, which design choice is most appropriate?

Multiple choice question 15
15.

In operational-space control for a mobile manipulator, the nullspace of the main task is used to perform a secondary task (e.g., posture optimization). Yet, over time, the secondary task pushes the arm toward a joint limit. Why does this occur?

Multiple choice question 16
16.

You call std::async(std::launch::async, [] { do_work(); }); and discard the returned future. Subsequently, the program appears to execute do_work() synchronously, blocking the main thread. What is the most likely explanation?

Multiple choice question 17
17.

Consider a class hierarchy where V is a virtual base class, B is derived virtually from V, and D is derived from B (non-virtually). In D's constructor member initializer list, both V and B are explicitly initialized. According to the C++ standard, in what order will the sub-objects be constructed?

Multiple choice question 18
18.

You implement a generic container that owns a heap‑allocated array. The move constructor transfers ownership and sets the source’s pointer to null, but you forget to mark it noexcept. When a std::vector reallocates, it copies elements instead of moving them. Why does this happen, and which change will enable move semantics during reallocation?

Multiple choice question 19
19.

In SimCLR, the NT‑Xent loss is computed over a batch of images, each augmented into two views. Training typically uses a very large batch size (e.g., 4096 or 8192). Which benefit does such a large batch size primarily provide for the quality of the learned representations?

Multiple choice question 20
20.

You are training a model with DistributedDataParallel (DDP) on 4 GPUs, using gradient accumulation over 8 micro‑batches. Your loop performs loss.backward() for each micro‑batch and then calls optimizer.step() after the last one. You forget to wrap intermediate backward calls with model.no_sync() or to toggle require_backward_grad_sync. You notice the effective learning rate is much smaller than expected compared to a single‑GPU run with the same total batch size. What is the most likely reason?

Multiple choice question 21
21.

You train a Byte Pair Encoding (BPE) tokenizer on a multilingual dataset, then fine‑tune a decoder-only transformer for next‑token prediction. During inference with beam search, you notice that the model frequently generates tokens that, when decoded, produce garbled text with mixed scripts or partial characters. What is the most plausible cause?

Multiple choice question 22
22.

In an off‑policy Q‑learning algorithm with linear function approximation and bootstrapping, the value estimates diverge. The environment is non‑stationary due to a changing target policy. Which component of the deadly triad is directly responsible for the instability, and what modification would most likely restore stability?

Multiple choice question 23
23.

In an Actor‑Critic algorithm for a continuous action space, the critic is updated with the reward and the next state’s value. The actor is then updated using a policy gradient that employs the critic’s Q‑value estimates for the action taken. Over several epochs, the critic’s loss decreases, but the actor’s performance plateaus. Monitoring reveals that the critic’s value estimates for expert‑like actions are significantly overestimated. Which phenomenon best explains this, and what adjustment could help?

Multiple choice question 24
24.

You train a world model on offline trajectories and use Model Predictive Control (MPC) with a learned reward function to select actions. During online evaluation, the agent achieves high return in the early steps of an episode but then suddenly performs erratic actions. Inspection shows that the planned trajectory uses states that the world model has never seen during training, leading to hallucinated high rewards. What is the root cause?

Multiple choice question 25
25.

You train a diffusion policy for a 7‑DOF robot arm to perform a task from human teleoperated demonstrations. The policy produces smooth trajectories in open‑loop rollout but fails in closed‑loop execution: it frequently overshoots and oscillates near the goal. You used high‑frequency demonstrations (100 Hz) and the policy outputs action chunks of 10 steps. What is the most likely reason for the instability?

Multiple choice question 26
26.

In whole‑body control of a humanoid robot, you formulate a quadratic program (QP) that minimizes the error of multiple tasks while satisfying contact, joint limit, and torque constraints. You set a high weight on the center‑of‑mass (CoM) position task and a lower weight on the head orientation task. During execution, the robot loses balance when the head orientation correction requires a large arm movement. Why does the QP fail to maintain balance despite the high CoM weight?

Multiple choice question 27
27.

You deploy a mobile manipulator for a long‑duration warehouse task. After three days of continuous operation, the robot’s picking success rate drops from 95% to 70%. You notice that the arm sometimes misses the grasp point by a few centimeters, and the base occasionally stops short of the expected position. The robot uses visual SLAM for localization and IMU for orientation. What is the most effective diagnostic to distinguish between calibration drift and a software performance regression?

Multiple choice question 28
28.

In contrastive learning, the InfoNCE loss is often interpreted as a lower bound on the mutual information (MI) between two views of the data. When you increase the number of negative samples (e.g., by using a large memory bank or a batch), the performance on downstream tasks improves up to a certain point and then plateaus. Which of the following is the most accurate explanation for this plateau?

Multiple choice question 29
29.

A whole-body controller for a humanoid robot uses a strict hierarchical quadratic programming (QP) formulation. The highest-priority QP enforces torque limits and a primary task (e.g., balancing), and then lower-priority tasks are solved in the nullspace of this first QP. Despite this, during fast movements, the joint torques occasionally exceed the specified limits. Which of the following is the most likely root cause?

Multiple choice question 30
30.

You are implementing a C++ library that performs a lazy evaluation pipeline: a user can chain transformations on a data stream, and the actual computation is deferred until final consumption. Each transformation is a user-provided callable that is stored for later execution. You want to maximize performance and allow the user to pass lambdas that capture external state by reference. Which design strategy best balances flexibility, performance, and safety?

Section 2 · Short answer

0/10 answered
1.

You are building a server that processes incoming requests using std::async with std::launch::async. After heavy load, the system starts thrashing due to excessive thread creation and unbounded task accumulation. Explain the problems of oversubscription and unbounded queues, then redesign the system using a fixed-size thread pool with work stealing. Describe the key components, how tasks are submitted, and how you would implement cancellation to avoid leaking resources.

Coding
2.

You are designing a class that represents a bounded buffer for inter-thread communication. The buffer has a fixed capacity and must be safe for concurrent use by one producer and one consumer. Specify the class's data members, constructor, and the push/pop methods. Discuss how you enforce the class invariant (buffer never overflows or underflows) and what synchronization mechanism you would use. Provide a reasoning for using condition variables versus atomics versus a semaphore.

Coding
3.

You are designing a C++ class for a reference-countered handle to a resource, similar to std::shared_ptr but with custom deleter support and support for aliasing (where the handle refers to a subobject of the controlled resource). Explain how you structure the control block, what the handle constructor/destructor do, and how you ensure thread safety for the reference count. Discuss the difference between storing a raw pointer and a pointer to the control block, and the aliasing constructor's semantics.

Coding
4.

SimCLR uses the InfoNCE loss for contrastive learning. Derive the InfoNCE loss from the perspective of maximizing mutual information between views of the same image, and explain how the temperature parameter affects the learning dynamics. Illustrate with an example: what happens when temperature is too high or too low? How does this relate to the uniformity and tolerance properties of the representation?

5.

When implementing a custom neural network layer in PyTorch that modifies gradients during backpropagation, explain the role of torch.autograd.Function and the forward/backward methods. Discuss the difference between saving tensors for backward, using ctx.save_for_backward, and detaching gradients. Provide an example of a layer that applies a gradient mask (randomly zeroing out some gradients) and describe potential pitfalls like accidental graph breaks and double backward memory issues.

Coding
6.

In autoregressive language modeling with subword tokenization (e.g., BPE), the model is trained with teacher forcing to predict the next token, but during generation it must sample from its own predictions, leading to exposure bias. Explain exposure bias and how it manifests in generated text. Discuss why even though perplexity might be low, generated sequences can be repetitive or degenerate. Propose and justify a training or inference intervention to mitigate exposure bias.

7.

The deadly triad in reinforcement learning is the combination of function approximation, bootstrapping, and off-policy learning. Explain why each of these individually is not fatal, but together they can cause catastrophic instability. Support your reasoning with a concrete example, such as a Q-learning update with a neural network on a replay buffer, and describe the mechanism of divergence (e.g., the Bellman residual iteration behaving like a non-contraction).

8.

Critic-only methods for continuous actions (e.g., Q-learning) are limited because the greedy policy improvement requires solving max_a Q(s,a) over a continuous space, which is an expensive optimization per step. Explain how actor-critic architectures circumvent this issue by using a parameterized policy and a critic that provides gradient-based guidance. Discuss why the actor can exploit inaccuracies in the critic, and how techniques like twin critics or clipped double-Q can mitigate this.

9.

Model-based RL can fail catastrophically when the learned dynamics model is imperfect. Describe the phenomenon of model bias and compounding rollout errors in the context of model-based planning, such as using a neural network dynamics model for model-predictive control (MPC). Explain why the planner might exploit model inaccuracies, and how Dyna-style approaches attempt to mitigate this by interleaving model-free updates. Provide a concrete scenario (e.g., a walking robot) and contrast the model-based and model-free strategies.

10.

Behavioral Cloning (BC) is popular for robot learning with teleoperated demonstrations, but it suffers from covariate shift and failure to recover from mistakes. Describe in detail how the distribution mismatch between training demonstrations and auto-regressive inference causes this, using the concept of compounding errors. Then explain how action chunking (predicting a sequence of actions) and DAGGER's interactive correction paradigm address different aspects of this problem. What are the trade-offs of action chunking in terms of reactivity and data efficiency?

0 / 40 answered