Generic Coding Flashcards

1
Q

What is a Data Structure?

A

A data structure is a storage format that defines the way data is stored, organized, and manipulated.
Some popular data structures are Arrays, Trees, and Graphs.

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

What is an Array?

A

An array is commonly referred to as a collection of items stored at contiguous memory locations.
Items stored are of the same type.
It organizes data so that a related set of values can be easily sorted or searched.

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

What is a Linked List?

A

Like an array, a linked list refers to a linear data structure in which the elements are not necessarily stored in a contiguous manner.
It is basically a sequence of nodes, each node points towards the next node forming a chain-like structure.

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

What is LIFO?

A

LIFO is an abbreviation for Last In First Out
It is a way of accessing, storing and retrieving data.
It extracts the data that was stored last first.

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

What is a Stack?

A

A stack refers to a linear data structure performing operations in a LIFO (Last In First Out) order.
In a stack, elements can only be accessed, starting from the topmost to the bottom element.qw45

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

What is a Queue?

A

A queue refers to a linear data structure that performs operations in a FIFO order.
In a queue, the least recently added elements are removed first as opposed to a stack.

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

What are Binary Trees?

A

A binary tree is an extension of the linked list structure where each node has at most two children.
A binary tree has two nodes at all times, a left node and a right node.

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

What is Recursion?

A

Recursion refers to a function calling itself based on a terminating condition.
It uses LIFO and therefore makes use of the stack data structure.

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

What is the OOPs concept?

A

OOPs stands for Object-Oriented Programming System, a paradigm that provides concepts such as objects, classes, and inheritance.

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

What are the concepts introduced in OOPs?

A

Following are the concepts introduced in OOPs:

Object - A real-world entity having a particular state and behavior. We can define it as an instance of a class.
Class - A logical entity that defines the blueprint from which an object can be created or instantiated.
Inheritance - A concept that refers to an object gaining all the properties and behaviors of a parent object. It provides code reusability.
Polymorphism - A concept that allows a task to be performed in different ways. In Java, we use method overloading and method overriding to achieve polymorphism.
Abstraction - A concept that hides the internal details of an application and only shows the functionality. In Java, we use abstract class and interface to achieve abstraction.
Encapsulation - A concept that refers to the wrapping of code and data together into a single unit.
This is one of the very common coding interview questions, that often allows the interviewer to branch out into related topics based on the candidate’s answers

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

Explain what a Binary Search Tree is.

A

A binary search tree is used to store data in a manner that it can be retrieved very efficiently.
The left sub-tree contains nodes whose keys are less than the node’s key value.
The right sub-tree contains nodes whose keys are greater than or equal to the node’s key value

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

Explain Doubly Linked Lists?

A

Doubly linked lists are categorized as a special type of linked list in which traversal across the data elements can be done in both directions.
This is made possible by the presence of two links in every node, one that links to the node next to it and another that connects to the node before it.

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