WorksheetsExplore Programming and Data Concepts
Total questions: 20
Worksheet time: 3mins
What is a stack and how does it differ from a queue?
A stack allows random access; a queue does not.
A stack is LIFO; a queue is FIFO.
A stack is a linear data structure; a queue is not.
A stack is FIFO; a queue is LIFO.
Explain the time complexity of binary search.
O(n log n)
O(1)
O(n)
O(log n)
What is normalization in database design?
Normalization in database design is the process of organizing data to minimize redundancy and dependency.
A method to increase data redundancy
A technique for data encryption
A way to merge multiple databases
Describe the difference between SQL and NoSQL databases.
NoSQL databases require a strict schema.
SQL databases are non-relational with a fixed schema.
SQL databases are relational with a fixed schema, while NoSQL databases are non-relational with flexible schemas.
SQL databases are designed for unstructured data.
What is overfitting in machine learning?
Overfitting happens when a model is trained on too much data, leading to confusion.
Overfitting is when a model performs well on training data but poorly on unseen data due to excessive complexity.
Overfitting is when a model performs poorly on both training and unseen data due to lack of data.
Overfitting occurs when a model is too simple and cannot capture the underlying patterns.
List the main types of machine learning.
Supervised learning, Unsupervised learning, Reinforcement learning
Transfer learning
Deep learning
Semi-supervised learning
What is the purpose of the pandas library in Python?
To perform web scraping tasks
The purpose of the pandas library in Python is to facilitate data manipulation and analysis.
To create visualizations of data
To manage databases in Python
How do you create a scatter plot using Matplotlib?
Import Matplotlib, prepare data, use plt.scatter(x, y), and plt.show()
Call plt.draw() before plt.show()
Use plt.plot(x, y) instead of plt.scatter(x, y)
Import Seaborn instead of Matplotlib
What is the difference between CSS and JavaScript?
CSS is a programming language; JavaScript is a markup language.
CSS is for styling; JavaScript is for interactivity.
CSS handles data storage; JavaScript manages server requests.
CSS is used for backend development; JavaScript is for database management.
Explain the concept of inheritance in Java.
Inheritance allows a subclass to inherit properties and behaviors from a superclass, promoting code reuse and establishing a hierarchical relationship.
Inheritance allows a superclass to inherit properties from a subclass.
Inheritance is used to create multiple instances of a class.
Inheritance is a method to delete properties in Java.
What is a function in Python and how is it defined?
A function in Python is defined using the 'def' keyword, followed by the function name and parentheses.
A function in Python is created with the 'create' keyword.
A function in Python is defined using the 'func' keyword.
A function in Python is defined by using the 'define' keyword.
What are the main data types in JavaScript?
array
function
undefined, null, boolean, number, string, symbol, object
date
What is the purpose of a primary key in a database?
The purpose of a primary key in a database is to uniquely identify each record in a table.
To store large amounts of data efficiently.
To group related records together in a table.
To define the structure of a database table.
Describe the process of training a machine learning model.
The process of training a machine learning model involves data collection, preprocessing, feature selection, model selection, training, validation, testing, and deployment.
Feature selection is the last step in the training process.
Data collection is not necessary for training a model.
Model training only requires a single dataset without validation.
What is the difference between supervised and unsupervised learning?
Supervised learning can only be applied to images, while unsupervised learning can only be applied to text.
Supervised learning requires no data for training, while unsupervised learning requires labeled data.
Supervised learning uses labeled data for training, while unsupervised learning uses unlabeled data to find patterns.
Supervised learning is used for clustering, while unsupervised learning is used for classification.
How do you handle missing data in a dataset?
Replace missing data with the maximum value of the dataset.
Assume all missing data is zero.
You can handle missing data by removing, imputing, or using algorithms that support it.
Ignore the missing data and proceed with analysis.
What is the use of the 'for' loop in Python?
The 'for' loop is used to iterate over a sequence or iterable in Python.
To handle exceptions in Python.
To create a new class in Python.
To define a function in Python.
Explain the concept of responsive design in CSS.
Responsive design in CSS ensures that web content adjusts seamlessly across different devices and screen sizes.
Responsive design requires separate CSS files for each device.
Responsive design is about using fixed layouts for websites.
Responsive design only applies to mobile devices.
What is the difference between a class and an object in Java?
A class is a type of object.
A class is a blueprint for creating objects, while an object is an instance of a class.
An object can exist without a class.
A class is a specific instance of an object.
How do you declare a variable in JavaScript?
You declare a variable using 'define'.
You declare a variable in JavaScript using 'var', 'let', or 'const'.
You can only use 'let' to declare variables.
Variables are declared with 'declare'.
