Technical Interview Flashcards

1
Q

What are the different types of SQL joins?

A

Inner Join, Left Join, Right Join, Cross Join

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Unique constraint?

A

In SQL, UNIQUE constraint is a database constraint that ensures that all values in a specific column (or a combination of columns) are unique across all rows in a table. This means that no two rows can have the same value(s) in the column(s) with a UNIQUE constraint. UNIQUE constraints are used to enforce data integrity and maintain the uniqueness of data in a table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the differences between IN and BETWEEN operators?

A

The IN operator allows you to determine if a value matches any value in a list of values while The BETWEEN operator is a logical operator that specifies whether a value is in a range or not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is meant by normalization in SQL?

A

Normalization is a process or set of guidelines used to optimally design a database to reduce redundant data. The actual guidelines of normalization are called normal forms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Is a blank space or a zero value treated the same way as the operator NULL?

A

No, blank spaces or zero values are not treated the same as NULL in SQL. NULL represents the absence of a value, while blank spaces and zero values are actual data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the default ordering of the ORDER BY clause and how can you change the default order?

A

The default ordering of the ORDER BY clause is ascending (ASC). To change the order to descending (DESC), you can add DESC after the column name. For example, ORDER BY column_name DESC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Write an SQL query to find all candidates’ names from a table named

A

‘Candidates’ that end with ‘K’.
SELECT * FROM Candidates WHERE name LIKE ‘%K’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Change Data Capture (CDC): what it is and how does it work?

A

Change Data Capture is a technique used to identify and capture changes made to data, whether those changes are inserts, updates, or deletes. The goal is to keep a record of all data changes in the system, making it easier to synchronize, replicate, or analyze these changes. CDC is useful for data warehousing, and ETL processes where you need to maintain up-to-date information without constantly querying the entire dataset.
Types include:
Trigger-Based CDC
Log-Based CDC
Polling or Timestamp-Based CDC
Database-mirroring CDC
API-Based

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Let’s suppose you want to deal with duplicate data in the SQL query. What functions are suitable for dealing with such data?

A

SQL provides several functions to deal with duplicate data, including DISTINCT, GROUP BY, and aggregate functions like COUNT(). These functions allow you to identify and eliminate duplicate rows or summarize data based on common attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain SQL indexing

A

In SQL, indexing is a database optimization technique used to improve the retrieval speed of rows from database tables. An index is a data structure that provides a quick way to look up rows in a table based on the values in one or more columns. Indexes are analogous to the indexes you find in a book: they help you quickly locate specific information without having to scan every page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the various kinds of permission under Linux?

Also, explain how to change permissions.

A

In Linux, there are three types of permissions: read (r), write (w), and execute (x). These permissions can be set for three categories of users: owner (u), group (g), and others (o).

You can change permissions using the chmod command, followed by a symbolic representation (e.g., chmod u+x filename to add execute permission for the owner).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What command would you use for editing, searching, and replacing text in Linux?

A

To search for text in a file, you can use the grep command:

grep ‘search-text’ filename

To search for text in multiple files within a directory (recursively), you can use the -r option:

grep -r ‘search-text’ directory/

To search for text in a case-insensitive manner, use the -i option

grep -i ‘search-text’ filename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Are Arguments in Python Passed by Value or by Reference?

A

All arguments are passed by reference

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What Is the Difference Between a List and a Tuple?

A

Mutability:

List: Lists are mutable, which means you can change their contents (add, remove, or modify elements) after creation. You can use methods like append(), insert(), and remove() to modify a list.

Tuple: Tuples are immutable, which means once you create a tuple, you cannot change its contents. You cannot add, remove, or modify elements in a tuple after it’s created. This immutability can make tuples faster and safer in certain situations.
Syntax:

List: Lists are created using square brackets [], e.g., my_list = [1, 2, 3].

Tuple: Tuples are created using parentheses (), e.g., my_tuple = (1, 2, 3).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How would you access and read a dataset in CSV Format on Google Spreadsheet? (read directly from the internet)

Import Pandas
Url = “url”
Dataframe = pd.read_csv(url)

Python

A

Import Pandas
Url = “url”
Dataframe = pd.read_csv(url)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly