Interview Questions Flashcards

1
Q

What is Data Structure?

A

The data structure is a way that specifies how to organize and manipulate the data. It also defines the relationship between them.

Data Structures are the central part of many compute algorithms as they enable data to be handled in an efficient way.

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

Describe the types of Data Structures?

A

Data Structures are mainly classified into two types:

Linear Data Structure: A data structure is called linear if all of its elements are arranged in the sequential order. In linear data structures, the elements are stored in a non-hierarchical way where each item has the successors and predecessors except the first and last element.

Non-Linear Data Structure: The Non-linear data structure does not form a sequence i.e. each item or element is connected with two or more other items in a non-linear arrangement. The data elements are not arranged in the sequential structure.

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

What are the areas of applications for data structures?

A

Compiler Design,
Operating System,
Database Management System,
Statistical analysis package,
Numerical Analysis,
Graphics,
Artificial Intelligence,
Simulation

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

What is the difference between file structure and storage structure?

A

The main difference between file structure and storage structure is based on memory area that is being accessed.

Storage structure: It is the representation of the data structure in the computer memory.

File structure: It is the representation of the storage structure in the auxiliary memory.

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

Which data structure is used to perform recursion?

A

Stack data structure is used in recursion due to its last in first out nature.
Operating system maintains the stack in order to save the iteration variables at each function call

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

What is a postfix expression?

A

An expression in which operators follow the operands is known as postfix expression. The main benefit of this form is that there is no need to group sub-expressions in parentheses or to consider operator precedence.

The expression “a + b” will be represented as “ab+” in postfix notation.

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

Write the postfix form of the expression: (A + B) * (C - D)

A

AB+CD-*

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

Which data structures are used in BFS and DFS algorithm?

A

In BFS algorithm, Queue data structure is used.

In DFS algorithm, Stack data structure is used.

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

In what scenario, Binary Search can be used?

A

Binary Search algorithm is used to search an already sorted list. The algorithm follows divide and conqer approach

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