PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Machine Learning/J.P. Morgan

Explain Overfitting and Transformer Basics

Last updated: Apr 11, 2026

Quick Overview

This question evaluates proficiency in core machine learning competencies such as overfitting and generalization, selection and regularization of loss functions for classification and regression, encoder-decoder sequence architectures, and self-attention mechanisms including queries, keys, and values, as well as considerations like bias–variance tradeoffs, masking, and attention computational cost. It is commonly asked in technical interviews for Machine Learning and Data Scientist roles because it probes both conceptual understanding and practical application of training dynamics, model architecture choices, and scalability trade-offs within the Machine Learning domain.

  • medium
  • J.P. Morgan
  • Machine Learning
  • Data Scientist

Explain Overfitting and Transformer Basics

Company: J.P. Morgan

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Technical Screen

Answer the following machine learning questions in a self-contained way: 1. What is overfitting? How would you recognize it from training and validation behavior, and what are several practical ways to reduce it? 2. Write down appropriate loss functions for common supervised learning settings, such as binary classification and regression, and explain when each is suitable. Include how regularization can be added. 3. Explain the encoder-decoder architecture used in sequence models. 4. Explain self-attention, including the roles of queries, keys, and values, and how it differs from older recurrent sequence models. A strong answer should also discuss tradeoffs such as bias-variance, model capacity, optimization vs generalization, masking in sequence generation, and the computational cost of attention for long sequences.

Quick Answer: This question evaluates proficiency in core machine learning competencies such as overfitting and generalization, selection and regularization of loss functions for classification and regression, encoder-decoder sequence architectures, and self-attention mechanisms including queries, keys, and values, as well as considerations like bias–variance tradeoffs, masking, and attention computational cost. It is commonly asked in technical interviews for Machine Learning and Data Scientist roles because it probes both conceptual understanding and practical application of training dynamics, model architecture choices, and scalability trade-offs within the Machine Learning domain.

Related Interview Questions

  • Explain Core ML Concepts - J.P. Morgan (medium)
  • Test whether samples follow a binomial distribution - J.P. Morgan (medium)
J.P. Morgan logo
J.P. Morgan
Apr 7, 2026, 12:00 AM
Data Scientist
Technical Screen
Machine Learning
3
0
Loading...

Answer the following machine learning questions in a self-contained way:

  1. What is overfitting? How would you recognize it from training and validation behavior, and what are several practical ways to reduce it?
  2. Write down appropriate loss functions for common supervised learning settings, such as binary classification and regression, and explain when each is suitable. Include how regularization can be added.
  3. Explain the encoder-decoder architecture used in sequence models.
  4. Explain self-attention, including the roles of queries, keys, and values, and how it differs from older recurrent sequence models.

A strong answer should also discuss tradeoffs such as bias-variance, model capacity, optimization vs generalization, masking in sequence generation, and the computational cost of attention for long sequences.

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Machine Learning•More J.P. Morgan•More Data Scientist•J.P. Morgan Data Scientist•J.P. Morgan Machine Learning•Data Scientist Machine Learning
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.