DSA Interview Questions
DSA Interview Questions
Date :
Page:
Data Structure
Intervin
uestions
By: Qcurious-programmer.
4Wbat is aTTay
An data structure for storinq
more than one dat item that bassimilar
data types.
An aray stored thdt position of each 'element
can be computed from its index by its formla.
In an grray se arching of element is. eqsy by
usingindex number.
Date:
Page:
QcurIOUJ-" proqrammr
6Wha is lioke list in data structure ?
I} js a seqyence of data stTUcture, wbich
qre connected toqether via liok9.
Eqch liok contan a connection to anoth erliok.
. Linked list can grow &shrink its size,
per the requrement
It does not wdaste memory spaee
TYpes of linked lists:
Singly linked list
) Doubly linked list
n) Circular linked list
7hat is stdck ?
Stqck is a linear data structure.
" stqck follows LIFO(Last Lo First Out ) or FILO
(First In Last Out).
In gtack elements dre ddded from top
- And element can deleted on from stek. top.
CIASSMALe
Doto:
Page:
Enter 2 Enter 3 2
EoeF-4
curiou 3--proqramme
Back Front
6
First In First Out
Out
CIASSMACe.
Dato :
Poge:
Pdrent sibtings
4
Children Leaf nodes
@curious-proqrammer
oWhat is qraph
’ A Graph i9 Consist of podes &edqes.
.Noes dre aleo called vertices
that conn ects nodes in c
&edge qre
Edqe
Vertices
@curious-.proqrammer
15 What is n alqorithm
An alqorithm is a step by step method of
solving a problem.
:Lt define6 a 6et of instruction to be enecuted
in certain order to get correct output:
The algorithm designed gre language independ.
and
I8bat 15 PUSH in DS ?
" The PUSH operator is used to insert
element in the stack
PUSH operation insert a ned element at the
top of stack.
If insert a new element io full sta ck , a overflow
condition occurS
PUSH gdd one element on top of the stack.
Oatq
ata
ta pota
Stqck
Qcurious-proqramer
Iglhat is Pop IO . S
’ The Pop operator is used to remove
element from stack.
POP operation removes q element from
top of stack.
stack underFlow condition occur cohen sta ck
1s empty and we try to delete element
from atack.
CIASSMAte
Dnto :
| Pago:
,
20/
What dynamic D.s ?
IE is colle ction of data in memery that
expand and contract to grou or shrink
in size q a proqram rUns.
This enables the proqrammer to control
exa ct how much memory is to be utili2ed.
Examples : dynamie arra linkedlist, stack,
queue, and heap.
22
What is a postfix expression?
A postfix expression is collection of operator
and operands in which the operator is
plqced after. the operands.
Lo a postf ix exprression the opeator Follows
the operands.
What is dequeue?
Seque i a type of queye in which insertion
renmovay of element can eithen be-peformed
from the front or the rear.
It not follows FIFO Rule
|Dato :
Pago:
curious-.-praqrg mmer.