MLStackMLSCCafé
 
 
Sign in with GoogleSign in with Google. Opens in new tab
Master Your ML & AIAI Interview
2103 Curated Machine Learning, Data Science, AI & LLMs Interview Questions
Answered To Get Your Next Six-Figure Job Offer

Top 62 Keras Interview Questions

Entry Junior Mid Senior Expert
Sign in with GoogleSign in with Google. Opens in new tab
Learning Progress:

Keras Theoretical Questions

Q1:   

In the EarlyStopping callback, when would you use mode='min' vs mode='max'?

  
Add to PDF   Junior 
Q2:   

Name the different ways to build a model with Keras that you know

  
Add to PDF   Junior 
Q3:   

What do compile, fit, and predict do in Keras sequential models?

  
Add to PDF   Junior 
Q4:   

What is the difference between predict and predict_on_batch methods of a Keras model?

  
Add to PDF   Junior 
Q5:   

What is the difference between Keras model.evaluate() and model.predict()?

  
Add to PDF   Junior 
Q6:   

What is the difference between model.fit() and model.evaluate() in Keras?

  
Add to PDF   Junior 
Q7:   

What is the use of verbose in Keras while validating the model?

  
Add to PDF   Junior 
Q8:   

How to get layer shapes in a Sequential model?

  
Add to PDF   Junior 
Q9:   

What does the Flatten layer do in Keras?

  
Add to PDF   Junior 
Q10:   

What's the difference between units, input shape and output shape in a Keras Layer class?

  
Add to PDF   Junior 
Q11:   

What is a callback in Keras and when is useful?

  
Add to PDF   Junior 
Q12:   

What are kernel_initializers in Keras and what is their significance?

  
Add to PDF   Junior 
Q13:   

How is defined the Input Layer in Keras?

  
Add to PDF   Junior 
Q14:   

How can I interrupt training when the validation loss isn't decreasing anymore?

  
Add to PDF   Junior 
Q15:   

Why would you use initial_epoch in a Keras Model?

  
 Add to PDF   Mid 
Q16:   

When would you use a Data Generator in Keras?

  
 Add to PDF   Mid 
Q17:   

How can you obtain the output of an Intermediate Layer (feature extraction)?

  
 Add to PDF   Mid 
Q18:   

What's the difference between trainable_weights and non_trainable_weights in Keras?

  
 Add to PDF   Mid 
Q19:   

How to create custom metrics with Keras?

  
 Add to PDF   Mid 
Q20:   

How to make two parallel convolutional neural networks in Keras?

  
 Add to PDF   Mid 
Q21:   

What's the difference between LSTM() and LSTMCell() in Keras?

  
 Add to PDF   Mid 
Q22:   

What is the purpose of Untrainable Weights in Keras?

  
 Add to PDF   Mid 
Q23:   

Add dropout layers between pretrained dense layers in Keras

  
 Add to PDF   Mid 
Q24:   

What's the difference between weight regularization and weight constraints layers?

  
 Add to PDF   Mid 
Q25:   

How to set Class Weights for imbalanced classes in Keras?

  
 Add to PDF   Mid 
Q26:   

Where would you put a BatchNormalization function in a Keras model?

  
 Add to PDF   Mid 
Q27:   

What is the difference between sparse_categorical_crossentropy and categorical_crossentropy?

  
 Add to PDF   Mid 
Q28:   

What is the use of train_on_batch() in Keras?

  
 Add to PDF   Mid 
Q29:   

How can you use a preprocessing layer in a TensorFlow/Keras model?

  Related To: TensorFlow
 Add to PDF   Mid 
Q30:   

What is the difference between an Embedding Layer and a Dense Layer in Keras?

  
 Add to PDF   Mid 
Q31:   

How to use LeakyRelu as activation function in sequence DNN in Keras?

  
 Add to PDF   Mid 
Q32:   

What's the difference between concatenate and add layers in Keras and when would you use each one?

  Related To: Deep Learning
 Add to PDF   Mid 
Q33:   

In Keras, what's the difference between kernel, bias, and activity regularizers, and when to use which?

  
 Add to PDF   Mid 
Q34:   

What is Transfer learning and how can you implement it in Keras?

  Related To: Deep Learning
 Add to PDF   Mid 
Q35:   

What is the advantage of using Functional vs Sequential models in Keras?

  
 Add to PDF   Mid 
Q36:   

When would you need to create a dynamic Keras model?

  Related To: Deep Learning
 Add to PDF   Senior 
Q37:   

What is a Cell Class in Keras?

  
 Add to PDF   Senior 
Q38:   

Why would you use a TimeDistributed layer after an LSTM layer?

  
 Add to PDF   Senior 
Q39:   

What's the difference between return_sequences and return_states in a LSTM layer in Keras?

  
 Add to PDF   Senior 
Q40:   

How is data processed by an LSTM layer in Keras?

  
 Add to PDF   Senior 
Q41:   

What is the purpose of the add_loss function in Keras?

  
 Add to PDF   Senior 
Q42:   

What does a layer SpatialDropout2D() do and why would you use it?

  
 Add to PDF   Senior 
Q43:   

What's the difference between Model methods __call__() vs. predict()?

  
 Add to PDF   Senior 
Q44:   

How to change the metric used by the EarlyStopping callback in Keras?

  
 Add to PDF   Senior 
Q45:   

How do you create a custom activation function in Keras?

  
 Add to PDF   Senior 
Q46:   

What does it means stateful = False and stateful = True in a LSTM layer?

  
 Add to PDF   Senior 
Q47:   

How can you use stateful RNNs in Keras?

  
 Add to PDF   Senior 
Q48:   

What is the difference between kernel_regularizer, bias_regularizer and activity_regularizer, and when to use which?

  
 Add to PDF   Senior 
Q49:   

How to stack multiple LSTMs with Keras?

  
 Add to PDF   Expert 
Q50:   

How to train a network only on one output when there are multiple outputs in Keras?

  Related To: Python
 Add to PDF   Expert 
Q51:   

How does Keras Embedding layer work?

  
 Add to PDF   Expert 
Q52:   

What does from_logits=True do in SparseCategoricalcrossEntropy loss function?

  
 Add to PDF   Expert 
Q53:   

What's the difference between batch, timesteps, features in LSTM layer input?

  
 Add to PDF   Expert 

Keras Practical Challenges

Q1:   

How would you freeze all the layers in the Keras model

  
 Add to PDF   Junior 
Q2:   

Using Keras, construct a simple autoencoder architecture using Dense layers and a Sequential model for 784-dimensional data

  Related To: Deep Learning, Neural Networks
 Add to PDF   Junior 
Q3:   

What does the Lambda layer do in Keras? What would be the output of this model?

  Related To: Python
  Add to PDF   Mid 
Q4:   

How to get the neural network weights for every epoch using Keras callbacks?

  
  Add to PDF   Mid 
Q5:   

Create code snippets that represent the different LSTM architectures using Keras

  
  Add to PDF   Mid 
Q6:   

How would you merge two different models in Keras

  
  Add to PDF   Mid 
Q7:   

Using Keras, how can you visualize the filters of some layer of a CNN?

  Related To: Neural Networks
  Add to PDF   Mid 
Q8:   

Construct a Model which takes two inputs and produces a single output

  
  Add to PDF   Mid 
Q9:   

How to concatenate two layers in Keras?

  
  Add to PDF   Senior 
 

Prepare for AI developer and engineer interviews with 19 answered OpenClaw questions covering Gateway architecture, channels, agent workspaces, memory, MCP, model failover, multi-agent routing, security, sandboxing, approvals, and remote operations....

Prepare for AI agent developer interviews with 15 Model Context Protocol (MCP) questions covering tools, resources, prompts, JSON-RPC, transports, roots, sampling, security, and practical MCP server design....

Amazone runs the internet as we know it. Amazon Web Services (AWS) offers a comprehensive suite of machine learning (ML) services that cater to various needs and expertise levels. Follow along and learn the 23 most common AWS machine-learning intervi...

Azure Machine Learning (Azure ML) is a cloud-based service for creating and managing machine learning solutions. It’s designed to scale, distribute, and deploy machine learning models to the cloud. Follow along and learn the 23 most common Azure Mach...
Hadoop is an open-source big data processing framework. It leverages distributed computing to store and process large datasets in a fault-tolerant manner. According to recent reports, Apache Hadoop is one of the most sought-after big data skills with...
Apache Spark is a unified analytics engine for large-scale data processing. It is built to handle various use cases in big data analytics, including data processing, machine learning, and graph processing. Follow along and learn the 23 most common an...
Scala is a powerful language with functional programming capabilities that can be a good choice for data science, especially in big data and distributed computing scenarios. As an example, Apache Spark, a popular distributed data processing framework...
PyTorch popularity as a Deep Learning framework of choice is on the rise. As of December 2022, 62% of the academic papers were implemented in PyTorch whereas only 4% were for TensorFlow. Follow along and prepare effectively with these key 30 PyTorch ...
The use of Artificial Intelligence (AI) in machine learning and data science enabled advancements in areas such as natural language processing, computer vision, recommendation systems, fraud detection, predictive analytics, and personalized medicine....
Optimization algorithms are extensively used in training machine learning models. Data engineers employ algorithms like gradient descent, stochastic gradient descent, and variants (e.g., Adam, RMSprop) to optimize the model parameters and minimize th...