# Top 40 TensorFlow Interview Questions and Answers

**Commonly Asked TensorFlow Interview Questions for Fresher**

### Q1. What is TensorFlow?

TensorFlow is the machine learning library developed by Google's brain team, it supports multiple abstraction levels, and we can choose the right level according to our need. We can build and train the models of machine learning with the help of keras, the high-level API. These types of API makes accessible to the TensorFlow and machine learning both. We don't need to change the model definition in tensor flow, when we want flexibility and the eager execution which allows for the next iteration and intuitive debugging for large machine learning tasks and use the circulation strategy API for circulated training on the various hardware configuration.### Q2. What do you understand by Tensors?

The Tensor is a vector or matrices of the n-dimension array that represents all type of data. A graph can conduct all operations in the Tensor, or we can say that the edge of the node is known as Tensor. We need a feature vector as the initial input to implement a Tensor. The models are feed with the list of objects in the machine learning; those objects are called feature vectors. We can understand the Tensors with the help of the diagram given below: In this diagram, the arrow represents multi-dimension. There is a Tensor which is known as stress, and it describe things happening in two directions.### Q3. How many types of Tensors?

There are three unique types of Tensor**which are used to create the neural network models:**

- Constant Tensor
- Variable Tensor
- Place Holder Tensor.

### Q4. What do you mean by Tensor board?

We can visualize the graphs with the help of Tensor board. We can say that the Tensor board is a suit of visualizing tool. It improves the accuracy of the Graphs and the flow of graphs. There are different types of the dashboards in Tensor board, which contain various tasks in the tensor board, which are the following:- Scalar Dashboard
- Histogram Dashboard
- Distributor Dashboard
- Image Dashboard
- Audio Dashboard
- Graph Explorer
- Projector
- Text Dashboard

### Q5. Explain the Architecture of TensorFlow?

TensorFlow Architecture works on three primary principles:- Pre-Process the data.
- Build the model according to the data sets.
- Trained and evaluate the model.

### Q6. Have you any idea about the latest release of TensorFlow?

The TensorFlow 2.0 Beta is the latest release of TensorFlow, different types of modules, classes and functions are exist in this version. Here, I explain some modules, Classes, and services in the table given below:Modules |
Classes |
Functions |

1. Audio module: It has public API for the tf.audio namespace. |
1.class Aggregation method: this class is listing aggregation methods used to combine gradients. | 1.Assert(): The Assert() method checks whether the given condition is actual. |

2.Errors modules: The errors modules are used for exception types of TensorFlow errors. |
2.class Tensor: the class Tensor represents one of the outputs of an operation. | 2.Bitcast(): This function is used to bit casts a Tensor from one type to another type without copying data. |

3.Estimator module: It's a high-level tool for working with the model in TensorFlow. |
3.class Module: It’s a base neural Network module class. | 3.cast(): The main work of this function casts a Tensor to a new type. |

### Q6.Explain the features of TensorFlow in short?

Some key features of Tensorflow are as follows:- Scalable
- Open source.
- Easily trainable on both CPU as well as GPU for circulated computing.
- It has auto differentiate capabilities.
- It provides threads, asynchronous computation, and queues
- Multi-platform Programming interface.
- TensorFlow has platform flexibility.
- Categorical vocabulary column: It is the most crucial feature of TensorFlow, we cannot input String directly to the model, we have to convert the String into numeric or categorical value. So, the Categorical vocabulary column supports String as one vector which is a numeric value.

- Feature column.
- Bucketized column.
- Hashed column.
- Crossed column
**.** - Indicator and embedded column is always the feature of TensorFlow.
- We are passing the feature column to estimator in TensorFlow
**.**

### Q7. What do you understand by TensorFlow Managers?

The TensorFlow managers are responsible for loading, unloading, lookup, and lifetime management of all serveable object via their loaders, its an abstract class. The managers are also used to handle the full life cycle of observables, such as loading servable, unloading servables. The syntax is below:#include<manager.h>

### Q8.What are the loaders of TensorFlow?

The loader can be implemented to load, access, and unload a new type of servable machine learning model, and these loaders are used for adding algorithms. The function load() is used to load model from the saved model.### Q9.Explain the deep Speech in TensorFlow?

The Deep Speech is an open source and used to convert Speech -To -Text engine. It is using the model trained by machine learning techniques based on Baidu's deep speech research paper. We can list the command line options through deep Speech, and the syntax for that is given below:./deepspeech.pyThe python script is (

*deepspeech.py*) in the root directory of the project. To create a more straightforward implementation, the project deep Speech uses Google's TensorFlow.

### Q10. Describe TensorFlow API in short?

There are lot of features which are similar to python, and the TensorFlow is same as a python package. The central core functionality of TensorFlow is circulation at runtime and implemented in various languages, and the python is one of them. There is TensorFlow's Circulated execution Engine, or the runtime engine exists in TensorFlow. It is a type of virtual machine, and there are various types of API's which are given below in the diagram:**C API for TensorFlow:**When we want to create the TensorFlow then, we should use the C API for TensorFlow.**C++ API for TensorFlow:**The C++ API supports mechanism for building and executing the data flow graph, it is simple to understand. This API is created to work with TensorFlow bazel build, and If you require a stand-alone option, you can use C API for that.

**Python API for TensorFlow:**Python API is famous for the TensorFlow, and it was one of the first language supported for TensorFlow. The python API is so diverse; that's why you need to decide before the use of python API according to your work.**R API for TensorFlow:**It is a different approach form other traditional approaches.**API’s Inside TensorFlow project:**These types of API’s are python based, API's inside TensorFlow always use to aid in designing a deep neural network, with a higher level of abstraction.**API’s Outside TensorFlow project:**There is an API tf.contrib.learn which is a separate package of python. The TensorFlowLayer is also an external TensorFlow project API, and the pretty Tensor is a Google’s project which provides an interface with chaining. The sonnet is also a project of Google, which is known as DeepMind. It has the feature of the modular approach.

### Q11. What are the pros and cons of TensorFlow?

#### Pros of TensorFlow

- We can easily use Keras as an interface for TensorFlow.
- It is an Open Source.
- It can be used as a general library.
- We can easily find resources of TesnorFlow and nicely coded and documented with the help of TensorFlow.
- When we compare to other libraries like Torch And Theano, the TensorFlow has excellent computational Graph Visualizations.
- The TensorFlow has high performance, quick updates, and new release with new features.
- It is scalable
- TensorFlow supports various types of debugging methods.
- You are visualizing the data and pipeline.

#### Cons of TensorFlow

- There is a workaround by using finite unfolding(bucketing), TensorFlow does not support this feature, so we can say that it’s a disadvantage of TensorFlow. If it comes to variable length sequences are the symbolic loops, that's why we can say that the TensoFlow has missing symbolic loops.
- Not supported for windows, if you want to use TensorFlow, so you have to install anaconda first on windows after that you can use TensorFlow on that.
- It lacks both speed and usage as compared to other libraries.
- The Computation speed is also a disadvantage of TensorFlow.

### Q12. What do you understand by TensorFlow Servables?

The servables are those type of objects which are used by clients to perform the computation; the size of servables is flexible. In inference models, a single servable include might be anything from a lookup table to a unique model in a tuple.### Q13. Explain sources in TensorFlow?

The Sources are that type of modules which provides servables, and every source can support zero or more servable stream. One loader is present for each servable version, that makes a servable version to get loaded.### Q14. What is Bias in TensorFlow?

The Bias is a type of Variables in Neural Networks, and It is the core concept of an artificial neural network. The Artificial Neural Network is the use of Bias variables to improve functions with a y-intercept other than zero.### Q15. What is the difference between Bias and Variance?

The main difference between Bias and Variance is that the Bias estimator's expected value and actual value of the parameter being estimated, on the other hand, the variance estimator value does not depend on the parameter being determined. Through variance estimator, we can measure how far amount can the estimate take, away from its expected value while the Bias estimator can alter accuracy.### Q16. What is Neural Network? Explain the role of Neural Network in TensorFlow?

The neural networks are designed to recognize the patterns, and these are the set of algorithms. We can interpret the sensory data through a kind of machine learning perception, labeling, or raw clustering input with the help of the neural network. When we develop those type of applications in which image recognition, speech recognition, and natural language processing are used, then we can use a neural network for this purpose in the TensorFlow.### Q17. Have you any idea about the general advantage of using the artificial Neural Network?

- We can use Artificial neural network for the processing of the brain as a Biases to develop algorithms, and we can also solve the Complex patterns of the models with the help of an artificial neural network.
- All the information that is in the network can receive in any format.
- The artificial neural network also has an excellent tolerance capability.
- The ANN is always used for real-time operations.
- We can find answers about the more complicated problems in a stepwise manner which is easier to understand.

### Q18. What do you mean by Variance?

There is a limit imposed on Variance so that the Variance is the type of a problem which comes when the machine learning algorithm is quite complicated. The Bias is generally treated as errors that declare their presence due to more assumptions.### Q19. What is the Recall and Precision in TensorFlow?

The Recall in TensorFlow is the real positive rate, and It is the general claim of positiveness of the whole model. The precision is in regards to the predictive value, which is positive.### Q20. Name some product which is built by using TensorFlow?

TensorFlow is used to build the following products:- Voice / sound recognition system.
- Text-based applications.
- Image recognition.
- Time series in systems.
- Video Detection.
- Teachable machine.

### Q21. What do you understand by the overfitting situation of the model?

The overfitting situation of the model is when the user is sure that there is no sophisticated statement in their model. The noise eliminates from the data, and Variance takes into their account.### Q22. What is the ROC curve?

The ROC curve is used in regards to the rate and reflects something significant, and these rates are classified as accurate positive and false positive rates. This curve represents all the information in the form of a graph. It can be mainly used as a proxy for the trade-off operations, which are related to different algorithms.### Q23. How can you Handle that situation which is indicating an unbalanced dataset?

This type of unbalanced datasets situation occurs due to the majority of data that is kept in one class only. We should resampling the dataset that is the best solution for this, and users also need to confirm that the data set is not damaged.### Q24. Have you any idea about the working of ROC curve?

There are three main tasks of ROC and AUC in TensorFlow, which are the following:- We have to create ROC plots for the binary classifiers, which is applied for the cross-validation.
- We can calculate AUC, and that is used for the comparison of classifier's performance.
- The ROC analysis can apply for the multi-classes classification, and we have to produce ROC for evaluating the individual class and the whole performance of classification.

### Q25. What do you understand by supervised and unsupervised machine learning?

**Supervised machine learning:**When we provide the data set to the model and guide the model or trained our model with the help of data set then that type of machine learning is known as supervised learning. This type of learning is the data mining task. The supervised learning algorithm analyzes the training data and creates an inferred function, which is used for the mapping new examples.

**Unsupervised machine learning:**The unsupervised learning is that type of machine learning in which we can provide the training of artificial intelligence algorithm and the information which is used that is not labeled, and allowed the algorithm to act on that information without any guidance and any trainer.

### Q26. What is the Fourier transform?

The Fourier transform is the mathematical concept, which is used for decomposing the generic function into the superposition of other features. These functions are symmetric, and it is always used to solve the complicated problems of mathematics.### Q27. Explain the type I and type II Errors?

**Type I Error:**The type I error is the false positive value, that type of error shows that something happens, but actually, it does not.

**Type II Error:**The type II error represents false negative value, this type of error is used to show the machine that there is nothing wrong, but actually, something exists, which is not good.

### Q28. How can you evaluate the logistic regression model?

The logistic regression model is the classification algorithm, which is used in machine learning; it allows categorized data in the discrete classes with the help of learning from the given set of Labeled data.### Q29. What is k-means clustering?

When we have a lot of data, we need to manage that type of data so we can categorize those type of data items into a group, this will achieve with the help of k-means clustering algorithm. The k-means clustering is the unsupervised learning algorithm, which solves the well-known clustering problem.### Q30. How useful and reliable the Baye's theorem, in machine learning according to you?

The Baye's theorem defines the probability of an event of machine learning, and it represents a fixed value, which is the mathematical calculation. There are some problems in machine learning, which are very complicated and not easy to understand; those type of questions can solve smoothly with the help of Baye's theorem.### Q31. What is F1 Score in machine learning?

The F1 Score is a type of Score in machine learning which provides clear information in regards to the whole performance of any model. This Score varies between the two values that are zero and one. The zero represents the worst Score. The f1 Score is conveyed balance in between the precision and recall.### Q32. What is deep learning?

The deep learning is wholly based on the artificial neural network, and it is the broader part of machine learning. There are three types of learning, supervised learning, semi-supervised and unsupervised learning, and we can achieve an unprecedented level of accuracy with the help of deep learning. In short, we can say that deep learning is an extensive neural network, and we can make learning algorithms much better and easier to use, with the support of deep learning.### Q33. What type of validation is used for the time series dataset?

The time series data set is not the randomly circulated data, we cannot be able to apply the standard technique here, such as k-folds because this type of methods involves the randomly dividing the dataset into k groups or folds of approximately equal size.### Q34. What do you mean by Kernel Trick?

The kernel tricks are used in some advanced calculation, and all functions are involved with this trick. The user can express these functions in terms of the product if the dimensional data is low, the kernel trick is also working in that situation.### Q35. What should you do, if a file is corrupted or missing in a dataset?

If any file is corrupted or missing in a dataset so, we can replace them with other values that run parallelly. There are two methods**Dropna**and

**isnull**to solve this situation.

### Q36. What do you mean by prunning in a decision tree?

We can reduce the size of the decision tree with the help of prunning technique, by removing sections of the tree that provides power to classify instances.### Q37. Have you any idea about deep learning and machine learning?

**Deep learning**Deep learning is the subpart of machine learning. There are various types of deep learning architectures, such as deep neural networks, deep belief networks, recurrent neural network, and convolutional neural network.

**Machine learning**The application of artificial intelligence is known as machine learning, and it is the scientific study of algorithms and statistical models. Machine learning is a subset of artificial intelligence.

### Q38. What is the difference between Pytorch and Tensorflow?

Pytorch |
TensorFlow |

1. The Pytorch is based on Torch. |
1. The TensorFlow is based on Theano. |

2. It is developed by Facebook. |
2. Google produces it. |

3. Pytorch is more easy to understand. |
3.TensorFlow is not so easy to understand. |

4. Pytorch includes computational graph at the runtime. |
4.TensorFlow does not have any option at run time. |

5. Pytorch doesn't have any feature like visualization. |
5.TensorFlow has Tensor board for visualizing machine learning model. |

### Q39. What is constant in TensorFlow?

The TensorFlow supports three main data types, which are constants, Variables, and placeholders. The function such as**tf.constant()**can create the constant.