expertConcurrency 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
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?