You are on page 1of 22

*

Quest
ionsf
acedbyPr
inceAr
yan*

*
COREJAVA*

Whatar
ethel
oopsandpur
poseofl
oops?
I
sifel
secomesunderl
oops?
Ty
pesofaccessmodi
fi
ersexpl
ain
Whati
sifel
sestat
ementandhowt
ouseEqual
sand
==i
nifel
sestat
ementwit
hexampl
es
WhySt
ri
ngi
simmut
abl
einj
ava.
Whi
chcl
assi
simmut
abl
eot
hert
hanst
ri
ng?
Howcanwecr
eat
eimmut
abl
ecl
ass?
Whati
ssingl
etonclassandhowcanwecr
eat
e
si
ngl
etoncl
assinjavawithex
ample?
Str
ingbuff
erv
sst
ri
ngBui
l
derv
sst
ri
ngwi
th
examples
Whati
sst
ri
ngpool
stackandheapmemor
yconcept
.?
Howmanyobj
ectwi
l
lbecr
eat
edwi
thnewkey
wor
d?
Wi
thdi
ff
erentscenar
ios

Whati
sStat
icinjav
ahowt ocal
lstat
icmet
hodand
canweusestat
icwithcl
ass?I
fnotwhy
Whyweusest
ati
ckey
wor
d?
Whati
sSt
ri
ngwhyt
her
eisconceptofSt
ri
ng?
Oopsconcepti
ndetai
l
swi
thr
eal
timeandwi
th
pr
ojectexampl
es.
Ov
err
idi
ngv
sov
erl
oadi
ng.
Doesover
loadi
nghappensi
ncompi
l
eti
meor
Runt
ime.?
Canwechangethewholemet hodvar
iabl
esof
i
nterf
acebyov
erri
ding?Expl
ainwhyandwhatwil
l
happen?
Whyjavadoesn'
tsuppor
tmul
ti
pleI
nher
it
ance?
Expl
ainwi
thexamples
Whyweneedabst
ractcl
assi
fwehav
eint
erf
ace.
Wheretouseabst
ractcl
assandwher
etouse
i
nter
face.
Whyweneedconst
ruct
ori
nabst
ractcl
ass.
Canweoverr
idestati
cmethodWhatwi
l
lhappeni
f
wetr
ytooverri
destati
cmethod.
Canweover
ri
depr
ivat
emet
hodwhatwi
l
lhappeni
f
wetr
ytodoso.
Canweover
ri
deov
erl
oadedmet
hod?Howwi
th
exampl
e?
Canweov
err
idef
inal
met
hodi
fwecanorcannot
why
Canweusef i
nalkeywordwi
thcl
assname.Whati
s
ther
ealti
meuseoff i
nalkey
word.Wher
eyouhave
usedi
tinyourpr
oject.
Whyweuseget
ter
sandset
ter
smet
hod?
Howy
ouachi
eveAbst
ract
ioni
nyourpr
oject
?
Whati
srunt
imepol
ymor
phi
sm?
Howt
oachi
eveI
nher
it
ance?
Whynotonl
yget
ter
s?
Dif
fer
encebet
weenf
inal
final
l
yfi
nal
i
zewi
thr
eal
time
examples.
Canwemakeconst
ruct
orPr
ivat
e?Whynotorwhyi
f
wecan?
Whati
sSy
stem.
out
.pr
int
lnexpl
ain.
Whati
spubl
i
cst
ati
cvoi
dmai
n(St
ri
ng[
]ar
gs){
Canwecr
eat
eobj
ecti
nobj
ectcl
ass?I
fyes/
nowhy
Way
stocr
eat
eobj
ecti
njav
a.
Expl
ainobj
ectl
i
fecy
cle.

*
col
l
ect
ion*
Di
ff
erencebet
weencol
l
ect
ionandcol
l
ect
ions?
Expl
aincol
l
ect
ioni
ndet
ail
s?
Whi
chcol
l
ect
ioncl
assi
ssy
nchr
oni
zed?
Isarr
aystat
icordy
namic?I
fstat
icwhatweusef or
dynamic?Andhowmuchsizewil
l beincr
easedi
f
arr
ayhavenospacelef
tandyouwi l
lusearr
ayli
st?
Di
ff
erencebet
weenar
rayl
i
standl
i
nkedl
i
st?
Whatweuseformani
pul
ati
onofdat
aandwhatwe
usef
orret
ri
evi
ngofdat
aincol
l
ecti
on?
Di
ff
erencebet
weenhashmapandhasht
abl
e?
Di
ff
erencebet
weenhashsetandhashmap?
Met
hodst
osor
tcol
l
ect
ion?
Howt
orev
ersel
i
sti
ncol
l
ect
ion?
I
nter
nal
wor
kingofhashmap?
I
fhashmapisnotthr
eadsafethenifmul
ti
ple
t
hreadsar
einvoki
ngthenwhatwill
happen?
Howt
odoi
ter
ati
oni
ncol
l
ect
ion?
Dif
fer
encebet
weeni
ter
ator
,enumer
atorandl
i
st
i
terat
or?
Whatweusef
orbi
dir
ect
ional
iter
ati
on?
Diff
erencebetweensy
nchr
oni
zedhashmapand
concurr
enthashmap?
Whatisconcur
rentmodi
fi
cat
ionexcept
ionhowt
o
handl
eit
?
Whati
sfai
lsaf
eandf
ail
fast
?
Whyweuseputmet
hodi
nst
eadofaddi
nhashmap?
Whyhashmapi
snotapar
tofcol
l
ect
ion?
Di
ff
erencebet
weencol
l
ect
ionandhashmap?
Whyl
i
nkedl
i
sti
mpl
ement
sbot
hqueueandl
i
st?
Whyhashmapdoesn'
tfol
lowinser
ti
onorderi
fitput
s
ent
ri
esasli
nkedl
isti
nthenodeofbucketori
ndex?
Compar
atorv
scompar
abl
e?Whent
ousei
t?

*
Thr
ead*

Whati
sdif
fer
encebet
weent
hreadand
mul
ti
thr
eadi
ng?
Whati
sdi
ff
erencebet
weenpr
ocessandt
hreadi
ng?
Way
stocr
eat
ethr
eadcl
ass?
Whi
chonei
sbet
terandwhy
?
Di
ff
erencebet
weenj
oinandsl
eepmet
hod?
Howt
ogi
vepr
ior
it
ytot
het
hread?
Explai
nwai
tnot
if
yandnot
if
yal
l
?Whyt
heyar
e
present
?
Whati
sobj
ectl
ockv
scl
assl
ock?
Whatwill
happenwhencal
l
ingt
hread.
run(
)inst
ead
oft
hread.
star
t()
Canwecal
lrunmet
hodbef
orest
artmet
hod?
Whyweneedt
oov
eri
der
unmet
hod?
Whati
ssy
nchr
oni
zedkey
wor
d?
Whati
sdeadl
ockandhowt
oav
oidi
t?
Whati
sthr
eadsaf
e?Benef
it
soft
hreadsaf
e.

*
JAVA8FEATURES*

Whatj
ava8f
eat
uresy
ouknow?
Expl
ainf
unct
ional
int
erf
acewi
thexampl
e?
Wher
etousel
ambdasexpr
essi
ons?
Whatmethodsweuseinfunct
ional
int
erf
aceot
her
t
hanrunnabl
eandcal
labl
e?
Whati
sstr
eam api
?Whyaeusest
ream api
for
col
l
ect
ion?
Methodsf
orst
ream api
wit
hbasi
ccodi
ngsor
ti
ng
et
c.
Di
ff
erencebet
weenf
il
terandmap
Whati
sdat
eti
meapi
wit
hexampl
es?

*
EXCEPTI
ONANDEXCEPTI
ONHANDLI
NG*
Di
ff
erencebet
weenexcept
ionander
ror
s.
Ty
pesofexcept
ion?
Ty
pesofcheckedanduncheckedexcept
ion?
Expl
ainexcept
ionhi
erar
chy
?
Way
stohandl
eexcept
ioni
njav
a?
Expl
aint
rycat
chandf
inal
l
y?
Canweusemulti
plecat
chandf
inal
l
ybl
ockwi
thand
wit
houtt
rybl
ock?
Di
ff
erencebet
weent
hrowandt
hrows.
Howy
ouusedt
ohandl
eexcept
ioni
nSpr
ingboot
?
Howt
ocr
eat
eyourowncust
omi
zedexcept
ion?
Whyt her
eisconceptofcompi
l
eti
meexcept
ioni
f
excepti
onshowsatrunti
me?
Whyt
hrowabl
eiscl
assnoti
nter
face?
Whattypesofexcept
iony
ougoti
npr
ojectandhow
youhandledi
t?

*
JUNI
T*
Howy
ouper
for
meduni
ttest
ing?
Whaty
ouusedf
oruni
ttest
ing?
Annot
ati
onsf
orJuni
t?
Howt
otestcont
rol
l
ercl
asswi
thj
uni
t?
Whi
channot
ati
onst
ocal
lfi
rstusi
ngj
uni
t.
Di
ff
erencebet
ween@bef
oreand@bef
oreCl
ass?

*
---
--
-ADVANCEDJAVA-
--
--
-*

*
jsp-Ser
vlet
s*
Di
ff
erencebet
weenj
spandSer
vlet
s?
Howt
oconf
igur
edat
abasewi
thJDBC
Whati
srequestdi
spat
cher
?
Jspl
i
fecy
cle?
Ser
vlet
sli
fecy
cle?
Whati
sSer
vlet
s?
Whati
sMVCpat
ter
n?
Whatar
ethet
agsi
njsp?Expl
aini
t.

*
Spr
ingBoot
*

WhySpr
ingBoot
?
Al
lannot
ati
ons:
-
Component ,contr
oll
er,
reposit
ory
,ser
vice,
requestPar
am, modelAttr
ibut
e,
SpringBoot
Applicat
ion,@Autowir
edetc.
St
artpoi
ntofspr
ingbootappl
i
cat
ion

Cont
rol
l
erv
sRestCont
rol
l
er
Requestmappi
ngv
sgetmappi
ng
Spr
ingv
sspr
ingboot
Adv
ant
agesofSpr
ingboot
Whati
sspr
ingmv
c?
Howt
ohandl
eexcept
ioni
nSpr
ingboot
Dependencyi
nject
ion
Ty
pesofdependencyi
nject
ion
Ty
pesofscope
Spr
ingAOC
Spr
ingcont
ainer
Pom.
xml
Whati
spr
ofi
l
ingi
nSpr
ingboot
?
Howt
osetpr
ofi
l
esi
nSpr
ingboot
?
Spr
ingact
uat
or?
Whati
sDAOcl
ass?
Howt
ododebuggi
ngi
nSpr
ingboot
?
Whatar
ebr
eakpoi
ntsandwat
chpoi
nts?

Whati
sspr
ingsecur
it
y?
Di
ff
erencebet
weenaut
hent
icat
ionandaut
hor
izat
ion?

*
Hiber
nat
e*

Whyhi
ber
nat
eov
erj
dbc?
Jpav
shi
ber
nat
e
Or
mvsj
pa

Annot
ati
onsofhi
ber
nat
e?
Whati
sent
it
ycl
ass?
Sessi
on
Sessi
onf
act
ory
Tr
ansact
ion
Sessi
onmanagement

Getv
sload
Sav
evssav
eor
updat
e
Lazyv
seagerl
oadi
ng
Manyt
oone,
onet
omany
N+1pr
obl
em
Hi
ber
nat
eli
fecy
cle

I
fweneedmobil
eNo.v
ali
dat
ingonly9,10,
11di
git
s?
Howwil
lyoudo?Whi
channotat
ionstouse?

Howt
oconf
ighi
ber
nat
ewi
thdat
abase?
*
Micr
oser
vicesandwebser
vices*

Whati
sRest
Restapi
vsRest
ful
webser
vices
RestCont
rol
l
er
Howt
oexposeRest
ful
webser
vices
Howt
oconsumeRest
ful
webser
vices
Met
hodst
oconsumeRest
ful
webser
vices
Whatar
etheht
tpmet
hodsex
plai
n
Di
ff
erencebet
weengetandpost
Di
ffbet
weendogetanddopost
Di
ffbet
weenpostandput
Di
ffbet
weenputandpat
ch
Whati
sjson
St
ruct
ureofj
son
Whati
spay
load
WhatpackageRestapi
comef
rom?
WhyRestov
erSoap?
Restr
esour
ces
Whymi
croser
vices?
Di
sadv
ant
ageofmi
croser
vices
WhyRest
ful
webser
vices
Adv
ant
ageofmi
croser
vices
Di
sadv
ant
agesofmi
croser
vices?
Whati
sfi
l
efor
mat
Whyj
son?
Whentouser
equestmappi
ngwhent
ouseget
mappi
ng

Supposewehave4micr
oser
vicesA,
B,CandDand
i
fCi sdownorhav
esomebugshowt ot
ackl
ethi
s
si
tuati
on?

*
AGI
LESCRUM METHODOLOGI
ES*
Whati
sagi
l
e?
Whati
sscr
um met
hodol
ogy
?
Whyyouchoseagi
l
einst
eadofwat
erf
all
aswat
erf
all
i
ssaf
e?
Whatar
escr
um cer
emoni
es?

HAVEy
ouat
tendedscr
um meet
ings?Whaty
oudi
d?
Hav
eyoui
nter
act
edwi
thcust
omer
s?
Whatuserst
ori
esy
ouwor
kedon?
Whati
sst
orypoi
nts?
Dayt
odaywor
k?
Scr
um mast
er?
Whodi
dEf
for
test
imat
ion?
Whatwer
ethespr
int
siny
ourpr
oject
?
Howmuchdev
eloper
sandt
est
erswer
einy
our
pr
oject
?
Whom y
ouusedt
orepor
tto?
Howy
ouusedt
ogety
ourassi
gnment
sofpr
oject
?
Whatwer
ethebackl
ogsi
nyourpr
oject
?

*
SQLQUESTI
ONS*

DDLVSDML
Di
ffbet
weenpr
imar
y,f
orei
gnanduni
quekey
s.
Whatar
ejoi
nswhyweusej
oinsandt
ypesofj
oins
Di
ffbet
weeni
nnerandout
erj
oin
Di
ffbet
weenl
eftandr
ightj
oin
Howt
oincr
easequer
yper
for
mance?
I
ndexi
ngi
nsql
Whatar
etheconst
rai
nts
Howt
ojoi
ndi
ff
erentcol
umns.
?
Tr
igger
sinsal
Pr
epar
edSt
atementi
nsal
Howt
osel
ectdat
ainmysql

CRUDoper
ati
oni
nmy
sql
:
-inser
t,del
ete,
updat
e,et
c
2ndMaxsal
aryi
nsql
(Anymaxsal
aryt
oo)

*
CODI
NG*

FI
BONCCI
Pal
i
ndr
ome
ev
enorodd
Sor
tusi
ngst
ream api
,bubbl
esor
t,et
c
Cr
eat
eanabst
ractcl
ass
Cr
eat
eani
nnercl
ass
Cr
eat
easi
ngl
etoncl
ass
Cr
eat
eaf
unct
ional
int
erf
ace
ReverseStr
ingwi
thoutusi
ngpr
e-def
inedmet
hodsor
funct
ions
Get1stnonr
epet
it
iveel
ementi
nthegi
venst
ri
ng
Remov
edupl
i
cat
esf
rom St
ri
ngandar
ray
Sortt
hegivenstr
ingthenf
indthemi
del
ementand
pri
ntthesum ofevennumbers

Pr
intal
lnonr
epet
it
ivechar
act
er
Pr
intv
owel
s/consonant

*ATLEASTLEARNHOW TOUSEABOUTFORLOOPS
I
FELSE, COLLECTI
ONMETHODS,
HOW TOCREATE
THREADCLASS*

*
PROJECTRELATEDQUESTI
ONS*

Expl
ainy
ourpr
oject
Expl
ainy
ourpr
ojectf
low
Rol
esandr
esponsi
bil
i
tiesi
nyoutpr
oject
Tool
sandt
echnol
ogi
esusedi
nyourpr
oject
?
Whychosemi
croser
vicesf
ory
ourpr
oject
?
Whatcol
l
ect
ionsconceptyouusedi
nyourpr
oject
andwher
ewithexamples?
Whatj
ava8featur
esyouusedi
nyourpr
ojectand
wher
ewithexamples?
Whatoopsconcepty
ouusedi
nyourpr
oject
?
Hav
eyouusedt
hreadi
nyourpr
oject
?
Hav
eyouusedabst
ractcl
assi
nyourpr
oject
?
Expl
ainhowimplementedRestf
ulwebser
vicesand
micr
oservi
cesi
ny ourproj
ect
?
Whyusedspr
ingMv
cfory
ourpr
oject
?
Whi
cht
ool
youusedf
ort
est
ingwebser
vices?
Howy
ouusedt
oshar
eyourcodeswi
thot
her
s?
Howy
ouusedt
ocommuni
cat
ewi
tht
est
ers?
Whatexcept
ionsy
ougoti
nyourpr
ojectandhowy
ou
handl
edit
?
Wher
eyouusedhashmapi
nyourpr
oject
?
Whatwer
eyourpr
ojectf
unct
ional
i
ties?
Whatbugsy
ougot
?
Howy
oudi
demai
lconf
igur
ati
oni
nyourpr
oject
?
Howy
oudi
dpdfi
ntegr
ati
oni
nyourpr
oject
?
Whatf
ramewor
kyouusedi
nyourpr
oject
?

*
--
--
--
--
--
--
--
--
*

*
NOTE1:
-*

FORSPRI
NGSECURI
TY,
Deploy
ment
,CI
/CD,
DOCKER,
CONVERTI
NGJARTOWARORWARTO
JAR,
AUTHENTI
CATI
ON,HI
GHLEVELDEBUGGI
NG

ANSWERI
S:-
*
MYSENI
ORUSEDTOTAKECAREOFI
T*

*
NOTE2:
-*

*I
FYOUDON'TKNOW THEANSWERSTHENTRI CK
YOURI
NTERVIEWERJUSTDON'
TSAYIDON'TKNOW*

*
ANDPLEASEDON'
TTELLWRONGANSWERSI
FYOUDON'
TKNOW THEANSWERS*

*
NOTE3:
-*

*PREPARETELLMEABOUTYOURSELFANDPROJECTI
NWELLORGANI
ZEDMANNERANDI
N
YOURWORDS*

You might also like