TensorFlow/PyTorch Framework Fundamentals Questions
Practical knowledge of a major deep learning framework. Includes understanding tensors, operations, building neural network layers, constructing models, and training loops. Ability to read and modify existing code in these frameworks. Knowledge of how to work with pre-built layers and models.
HardSystem Design
45 practiced
Design an inference optimization pipeline to deploy a large Transformer for low-latency GPU inference. Outline steps including exporting to ONNX or TorchScript, operator fusion, TensorRT conversion, dynamic batching, quantization options, server choices (TorchServe/TensorFlow Serving/TensorRT Inference Server), and how to measure/validate latency and correctness.
MediumTechnical
38 practiced
You're fine-tuning a pre-trained transformer (Hugging Face) for text classification in PyTorch. Describe the steps to replace the classification head, freeze the base model initially, specify different learning rates for the head and the base, and then unfreeze and fine-tune with layer-wise learning rate decay. Include code snippets or param group examples.
HardTechnical
44 practiced
Implement a custom PyTorch autograd.Function for an operation where the forward() returns y = x * sigmoid(x) and backward() returns the correct gradient analytically. Provide the class skeleton with forward and backward static methods, show how to call it in a model, and explain how to test it with torch.autograd.gradcheck.
EasyTechnical
35 practiced
Explain how automatic differentiation works in PyTorch (autograd). In your answer, include: what requires_grad means, how the dynamic computation graph is built and used during backward(), and a short example where you compute gradients of y = 3*x^2 + 2*x for x being a tensor with requires_grad=True.
EasyTechnical
46 practiced
In TensorFlow 2.x (eager mode), explain the difference between tf.constant and tf.Variable. Provide a minimal code example that creates a Variable x initialized to 0.0 and uses tf.GradientTape to perform one gradient descent step to minimize f(x) = (x - 5)^2. Explain how to update the variable and how the gradient is observed.
Unlock Full Question Bank
Get access to hundreds of TensorFlow/PyTorch Framework Fundamentals interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.