0% found this document useful (0 votes)
44 views

Software Testing Interview - 1698897258390

This document contains 30 questions and answers related to software testing interviews. Some key topics covered include Selenium, synchronization, implicit and explicit waits, Page Object Model, Webdriver interface, locators like XPath and CSS, exceptions like NoSuchElementException, and handling stale element exceptions.

Uploaded by

kartheekpython
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Software Testing Interview - 1698897258390

This document contains 30 questions and answers related to software testing interviews. Some key topics covered include Selenium, synchronization, implicit and explicit waits, Page Object Model, Webdriver interface, locators like XPath and CSS, exceptions like NoSuchElementException, and handling stale element exceptions.

Uploaded by

kartheekpython
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

Sofware Tesng Inerview Quesons and Answers

https://www.linkedin.com/in/shady-ahmed97/

https://github.com/Shady1997

ABSTRACT
Sofware Tesng Inerview Quesons and Answers
(Manual Tesng, API, Perormance Tesng,
Auomaon Tesng, Java, Maven, TesNG, Daabase,
Agile) suppored wih cases sudy

Shady Ahmed Mohamed

SOFTWARE https://chat.whatsapp.com/JHbX1

TESTING https://t.me/+e9mrF1oMSM1jNW

INTERVIEW
Sofware Tesng Inerview Quesons and Answers
Selenium:
1.Wha are he challenges during auomaon esng?

- Challenges during esng may include handling dynamic elemens, synchronizaon, idenying elemens wih
changing aribues, and ensuring cross-browser compabiliy.

2.Wha sraegies you ollowed while building a Selenium ramework rom scrach?

- Common sraegies include srucuring code using Page Objec Model (POM), using es daa exernalizaon,
implemen reporng and logging, and employing a version conrol sysem.

3.Where do you perorm he singleon design paern? I you don' use i, hen do you have an idea abou his?

- The singleon design paern is ofen used o ensure a single insance o a WebDriver hroughou he es suie o
preven resource wasage.

4.Dierence beween Implici, Explici, and Fluen wais in Selenium?

- Implici wai ses a deaul waing me or all elemens.


- Explici wai is used or specic elemens and condions.
- Fluen wai is an exension o explici wai wih more cusomizaon.

5.Pros and cons o Implici and Explici wais?

- Pros o Implici wai: Simpliciy.


- Pros o Explici wai: Precise conrol.
- Cons o Implici wai: I's applied globally, which may lead o unnecessary waing.
- Cons o Explici wai: Requires more explici coding.

6.Why do we preer explici wai insead o uen wai? Wha are he disadvanages o uen wai?

- Explici wais are more versale and oer ne-grained conrol, while Fluen wais are ofen considered less readable
and harder o use.

7.Wihou implici wai, will a Selenium scrip work or no?

- Selenium scrips will sll work wihou an implici wai bu may no wai or elemens o load, poenally causing
synchronizaon issues.

8.Wha is he deaul polling me in explici wai and in implici wai?

- The deaul polling me in explici and implici wais is 500 milliseconds.

Creaed By Eng. Shady Ahmed +201023527158


9.Explain abou synchronizaon in Selenium?

- Synchronizaon is he process o ensuring ha he auomaon scrip and web applicaon are in harmony, prevenng
scrip execuon beore he web page is ready.

10.Which concep is implemened in explici and uen wai?

- Boh explici and uen wais rely on he “WebDriverWai” class o speciy waing condions.

11.Explain absracon and inerace in Selenium wih some examples.

- Absracon involves creang absrac classes or ineraces or page objecs, making he code more modular. For
example, using an absrac Page class.

12.Dierence beween Facory design and Singleon ramework?

- Facory design ocuses on creang objecs, while Singleon ensures only one insance exiss. They serve dieren
purposes.

13.Wha is page objec and page acory model?

- Page Objec Model (POM) is a design paern ha represens web pages as Java classes.
- Page Facory is a class provided by Selenium o inialize elemens in POM classes.

14.Have you used an inerace in your ramework oher han Selenium ineraces?

- In your ramework, you can use ineraces o dene common behavior or page objecs.

15.How do you achieve inheriance in your ramework?

- Inheriance can be used o creae a hierarchy o page objecs or cusom uliy classes.

16.Wha is Webdriver, and wha are he mehods ha do no have an implemenaon?

- Webdriver is an inerace. Some mehods wihou implemenaon include ge(), ndElemen(), and navigae().

17.Wha are he mehods presen in he webdriver inerace?

- Mehods like ge(), ndElemen(), navigae(), and ohers are presen in he WebDriver inerace.

18.Wha's he ases locaor in Selenium?

- CSS locaors are generally aser han XPah.

Creaed By Eng. Shady Ahmed +201023527158


19.Wha does :: (doubles colon) in sibling Xpahs represen?

- :: is used in XPah 2.0 o reerence uncons or pseudo-elemens.

20.Explain "Driver.manage.window.maximize" (alk abou he opon inerace here)

- This code maximizes he browser window. Driver.manage() reurns an insance o he Opons inerace.

21.Wha is he dierence beween ge() and navigae().o() in Selenium?

- Boh mehods navigae o a URL, bu ge() is shorer and more inuive.
- Ge open URL and wai page o load bu navigae no wai page o load.

22.How would you check or broken links on a webpage?

- To check or broken links, you can ierae hrough all links, send HTTP requess, and check he response saus code
(e.g., 404 or no ound).

23.Dierence beween submi() and click() in Selenium?

- submi() is used o submi a orm, while click() is used o simulae a click acon on a web elemen like a buon or a
link.

24.Dierence beween absolue XPah (/) and relave XPah (//)

- Absolue XPah sars rom he roo node o he documen, while relave XPah sars rom he curren conex node.
- Relave XPah is generally preerred or robus and mainainable auomaon.

25.Dierence beween ndElemen and ndElemens?

- ndElemen reurns he rs maching web elemen or hrows an excepon i no ound.
- ndElemens reurns a lis o maching web elemens or an empy lis i none are ound.

26.Dierence beween rames and irames?

- Frames are HTML elemens ha allow you o divide a webpage ino mulple secons.
- irames (inline rames) are rames embedded wihin a webpage.

27.Reurn ype o ndElemen and ndElemens?

- ndElemen reurns a single WebElemen.


- ndElemens reurns a lis o WebElemens.

Creaed By Eng. Shady Ahmed +201023527158


28.Wha error will be hrown when no elemen is ound or ndElemen and ndElemens?

- “NoSuchElemenExcepon” is hrown by Selenium when “ndElemen” or “ndElemens” canno locae an elemen.

29.Sae some excepons which you have aced in your ramework (Don' menon only Selenium, explain Java excepons
as well).

- Common excepons in Selenium include NoSuchElemenExcepon, TimeouExcepon, and


SaleElemenReerenceExcepon. In Java, here are many excepons or various siuaons.

30.Types o Excepons and how o handle sale elemen excepon?

- Common ypes o excepons include NoSuchElemenExcepon, TimeouExcepon, SaleElemenReerenceExcepon.


To handle SaleElemenReerenceExcepon, re-locae he elemen or reresh he page.

31.Wha are he ineraces used in Selenium?

- Commonly used ineraces in Selenium include WebDriver, WebElemen, Aler, JavascripExecuor, and more.

32.Where do you use inheriance in Selenium?

- Inheriance can be used o creae a hierarchy o es classes, cusom uliy classes, and page objec classes or a more
organized es ramework.

33.How do you inialize web elemens in POM? Wha error or excepon will come i no iniaed?

- Web elemens in POM are ypically inialized using he @FindBy annoaon and PageFacory class. I no inialized,
you may ge a NullPoinerExcepon or similar excepons when rying o use hem.

34.I boh wai mehods, ha is implici and explici, are menoned in he scrip, hen which one will work? Is i good
pracce o menon boh?

- I boh are used in he same scrip, explici wai akes precedence or he elemens ha have explici wais applied.
Menoning boh can be redundan and no considered a good pracce.

35.Wha is he dierence beween close() and qui() in Selenium?

- close() closes he curren browser window or ab.


- qui() exis he enre browser session and releases all associaed resources.

36.How do you handle Alers in Selenium?

- To handle alers, you can use he Aler inerace and is mehods like accep(), dismiss(), and geTex().

Creaed By Eng. Shady Ahmed +201023527158


37.In a web page, here are several Pop-up, bu we don' know when he pop-up will appear. In his case, how will you
handle he Pop-up using Selenium WebDriver (Java)?

- You can handle pop-ups by using explici wais and handling he pop-up when i appears or by swiching o he pop-up
window using driver.swichTo().window(windowHandle).

38.How o handle le upload when he ype aribue does no speciy he le or he upload web elemen?

- To handle le uploads when he ype aribue is no specied, you can use he sendKeys() mehod o send he le
pah o an <inpu ype="le"> elemen.

39.How o cover characer keyboard operaons rom he conex menu ulizing a user-dened keyword?

- To cover keyboard operaons, you can use he Acons class o build and perorm a cusom keyword ha simulaes
keyboard shorcus.

40.Consider his snippe: WebDriver driver = new ChromeDriver(); Wha does he above code snippe mean?

- This code inializes a Chrome WebDriver insance or browser auomaon.

41.Where can "Dynamic Polymorphism" in Selenium WebDriver be observed?

- Dynamic Polymorphism is observed when mehods like ndElemen or click behave dierenly based on he conex
(elemen ype, sae, ec.).

42.Wha is he dierence beween "/" and "//" in XPah?

- "/" reers o an absolue XPah, sarng rom he roo node.


- "//" is used or a relave XPah, searching rom he curren conex node.

43.I proper Xpah, CssSelecor, and ID are no available, how do you ideny an objec?

- I proper locaors are no available, you may resor o using oher aribues, CSS classes, or JavaScrip o locae
elemens.

44.Aribues o CSS Selecor?

- CSS Selecors can be based on aribues like id, class, ag name, aribue name, or elemen hierarchy.

Creaed By Eng. Shady Ahmed +201023527158


45.Which is aser, XPah or CSS?

- CSS locaors are generally aser han XPah, bu perormance can depend on he browser and specic use cases.

46.How o ge he nh elemen using XPah and CSS?

- To ge he nh elemen, you can use [n] in boh XPah and CSS selecors, where n is he index (0-based).

47.Consider you are only allowed o use CSS locaor, how will you nd he paren/grandparen o a web elemen?

- CSS does no provide a direc way o selec a paren or grandparen elemen. You may need o use JavaScrip.

48.Will driver.ndElemens() hrow an excepon?

driver.ndElemens() does no hrow an excepon and reurns an empy lis i no elemens are ound.

49.Wha is reurned by driver().manage()?

- driver().manage() reurns an insance o he Opons inerace, which is used or browser window managemen.

50.In Selenium, i you wan o access he elemen ha has he ex "This elemen has an ID ha changes every me he
page is loaded" in i, hen which o he ollowing will you use?

- You can use XPah or CSS selecors ha arge he elemen's ex, aribues, or hierarchy o locae i

51.Sared auomaon es suie execuon and a ew es cases ailed in a es run. How can you execue only ailed es
cases a once wih one click? Wha design paern do we use when we rigger dieren browsers?

- To rerun ailed es cases, you can use esng-ailed.xml, a esng.xml le conaining only he ailed es cases. Design
paerns like he Facory Paern can be used or browser managemen.

52.Wha are he approaches o handle dynamic WebElemens?

- Handling dynamic elemens may require using explici wais or modiying locaors o use paral or sable aribues.

53.How o click he las opon in a dynamically changing dropdown (Las dropdown changes dynamically)?

- To click he las opon in a dynamically changing dropdown, you can locae he dropdown, dynamically calculae he
las opon, and click i.

54.How o calculae links on a page (Answer wih HTML ag)?

- You can calculae links on a page by locang all anchor (<a>) elemens in he HTML and counng hem.

Creaed By Eng. Shady Ahmed +201023527158


55.Wrie he code o read he value rom he Excel shee.

- You can read values rom an Excel shee using libraries like Apache POI in Java.

56.Wha is Page Facory in POM Design paern?

- Page Facory is a class provided by Selenium ha allows easy inializaon o page elemens in he Page Objec Model
(POM) design paern.

57.Suppose you have 10 pages in your applicaon. How do you achieve POM? Wha will you do?

- In POM, you creae a separae Java class or each page and dene web elemens and mehods specic o ha page.

58.Wha annoaons are used in Page Objec Model?

- Common annoaons used in Page Objec Model (POM) include @FindBy, @FindBys, and @CacheLookup.

59.Ways o nd broken links in Selenium?

- To nd broken links, ierae hrough all links, send HTTP requess, and check or response saus codes. A valid link
should reurn a 200 (OK) saus code.

60.How o handle rames in Selenium?

- To handle rames, use driver.swichTo().rame() o swich o he rame by index, name, or a reerence o he rame
elemen.

61.How o handle Alers in Selenium?

- To handle alers, use driver.swichTo().aler() o inerac wih JavaScrip alers, conrmaons, and promps.

62.Dieren ypes o Navigaon Commands?

- Navigaon commands include navigae().o(), navigae().back(), navigae().orward(), and navigae().reresh() or


browser navigaon.

63.Dierence beween asser and veriy?

- asser and veriy are used or asseron in es scrips. The key dierence is ha asser sops he es i i ails, while
veriy allows he es o connue.

Creaed By Eng. Shady Ahmed +201023527158


64.How o download a le using Selenium?

- You can se browser preerences o speciy he download older and handle le download dialogs o auomae le
downloads.

65.How do you manage a se o Daa Tables in Selenium?

- You can use libraries like Apache POI or handle daa ables as web elemens o rerieve and manipulae daa.

66.How do you auomae localizaon esng (dieren languages in he UI)?

Localizaon esng involves changing he browser's language setngs and checking i he web applicaon displays conen in
he correc language.

67.How o avoid NoSuchElemenExcepon wihou using a ry/cach block and wih a ry/cach block?

- You can use explici wais o handle elemen visibiliy and avoid excepons. Wih ry/cach, you can cach he
excepon and ake appropriae acon.

68.How o handle web ables whose values change dynamically?

- Dynamic web ables may require nding he able elemen, ierang hrough rows and columns, and locang specic
daa.

69.How o check wheher a web elemen is enabled or disabled wihou using isEnabled mehod?

- You can use he geAribue("disabled") mehod o check i an elemen is disabled.

70.Why is CSS locaor aser han XPah?

- CSS locaors are usually aser han XPah due o heir opmized synax and implemenaon in browsers.

71.Even hough CSS is aser han XPah, why do 95% o companies use XPah?

- XPah provides more powerul and exible ways o locae elemens, which may be required or complex scenarios.

72.Wha should be done when an elemen is no ound, bu i's available on he web page? The elemen is no hidden, so
no need o use JavaScrip Execuor. How do you solve his?

- Ensure ha he locaor is correc, he elemen is wihin he curren rame, and here are no dynamic aribues
aecng he elemen's visibiliy.

Creaed By Eng. Shady Ahmed +201023527158


73.How do you execue ess in headless mode?

- You can run ess in headless mode by setng he browser o headless mode using opons and capabilies provided
by WebDriver.

74.In Selenium, how o ge he ex value rom a ex-box i geTex() is no working?

- I geTex() doesn' work, you can use geAribue("value") o ge he value o a ex box.

75.I we are using he correc locaor bu sll getng an "elemen no ound" error, hen how will you resolve his error?

- Check i he elemen is wihin he curren rame, here are no dynamic aribues, and synchronizaon issues exis.
You may need o use explici wais.

76.In Page Objec Model, once you creae LoginPage.java class, wha is he rs hing you sar wih wring inially? How
are you iniang wring somehing ino a page class?

- The rs sep is dening he web elemens using @FindBy annoaons. Then, creae mehods o inerac wih hose
elemens.

77.Wha i a Windows popup occurs during es execuon, and due o ha, you can' execue auomaed ess? How will
you resolve his error?

- You can use hird-pary libraries like AuoIT or he Robo class in Java o inerac wih sysem dialogs.

78.Dieren ways o handle hidden elemens?

- Hidden elemens can be handled by using JavaScrip o manipulae heir visibiliy or by modiying heir aribues.

79.Wha is he dierence beween click() uncon in WebElemen inerace and click() uncon in Acons class?

- Boh click() uncons are used or clicking, bu he Acons class allows or complex ineracons and is commonly used
or righ-click acons.

80.Is i possible o change he behavior o a es a runme?

- Tes behavior can be changed a runme using condional saemens or by reading conguraons rom exernal
sources.

81.How o click he righ-click o he mouse using Selenium?

- You can righ-click using he Acons class o build and perorm he righ-click acon.

Creaed By Eng. Shady Ahmed +201023527158


82.How o scroll down a page?

- You can scroll down a page using JavaScrip by execung a scroll command hrough he WebDriver.

83.Wha will driver.geWindowHandles() reurn?

- driver.geWindowHandles() reurns a se o window handles or all open windows or abs.

84.How will you auomae Windows-based applicaons?

- For Windows-based applicaons, you can use ools like AuoIT or WinAppDriver, which provide WebDriver-like
capabilies or Windows apps.

85.How o rerun only ailed es cases wih one click and wha design paern is used when riggering dieren browsers?

- You can rerun ailed es cases using TesNG's esng-ailed.xml conguraon le. The Facory Design Paern is ofen
used or managing dieren browsers.

86.Wha are he approaches o handle dynamic WebElemens?

- Dynamic WebElemens can be handled using explici wais, modiying locaors, or using regular expressions when he
aribue values change.

87.How o click he las opon in a dynamically changing dropdown (Las dropdown changes dynamically)?

- To click he las opon in a dynamically changing dropdown, you can locae all opons and choose he las one
programmacally.

88.How o calculae links on a page (Answer wih HTML ag)?

- To coun links on a page, locae all anchor <a> ags in he HTML and coun hem using Selenium.

89.Wrie he code o read values rom an Excel shee.

- You can use libraries like Apache POI o read values rom Excel shees in Selenium. Here's a sample code snippe in
Java:

FileInpuSream s = new FileInpuSream("pah/o/excel/le.xlsx");

XSSFWorkbook workbook = new XSSFWorkbook(s);

XSSFShee shee = workbook.geShee("Shee1");

Creaed By Eng. Shady Ahmed +201023527158


XSSFRow row = shee.geRow(0);

XSSFCell cell = row.geCell(0);

Sring cellValue = cell.geSringCellValue();

90.Wha is Page Facory in he Page Objec Model design paern?

- Page Facory is a class provided by Selenium o inialize elemens wihin Page Objecs, improving code mainainabiliy
and readabiliy.

91.Suppose you have 10 pages in your applicaon. How do you achieve Page Objec Model (POM)? Wha will you do?

- In Page Objec Model (POM), you creae a separae class or each web page, dening he page's elemens and acons
as mehods wihin he class.

92.Wha annoaons are used in Page Objec Model (POM)?

- Common annoaons used in POM include @FindBy, @FindBys, and @CacheLookup.

93.Ways o nd broken links in Selenium?

- To nd broken links, you can locae all anchor elemens, send HTTP requess, and veriy he response saus code. A
valid link should reurn a 200 (OK) saus.

94.How o handle rames in Selenium?

- To handle rames, you can use driver.swichTo().rame() o swich o a rame by index, name, or WebElemen
reerence.

95.How o handle Alers in Selenium?

- You can handle JavaScrip alers using mehods rom he Aler inerace, such as accep(), dismiss(), and geTex().

96.Dieren ypes o Navigaon Commands?

- Navigaon commands include navigae().o(), navigae().back(), navigae().orward(), and navigae().reresh() or


browser navigaon.

97.Dierence beween asser and veriy?

- Boh asser and veriy are used or making asserons in es scrips. The primary dierence is ha an asser ails he
es i i's no rue, while veriy connues execung he es and repors he resul.

Creaed By Eng. Shady Ahmed +201023527158


98.How o download a le using Selenium?

- To download a le, you can congure he browser's download setngs and handle le download dialogs using
Selenium.

99.How do you manage a se o Daa Tables in Selenium?

- To manage daa ables, you can use libraries like Apache POI or rea ables as web elemens, parsing heir conen or es
daa.

100.How do you auomae localizaon esng (dieren languages in he UI)?

- Auomang localizaon esng involves changing he browser's language setngs and veriying ha he UI displays conen
in he correc language.

101.How o avoid NoSuchElemenExcepon wihou using a ry/cach block and wih a ry/cach block?

- You can avoid NoSuchElemenExcepon using explici wais o ensure elemen visibiliy. Wih ry/cach, you can handle he
excepon graceully by caching i.

102.How o handle web ables whose values change dynamically?

- For dynamic web ables, locae he able, ierae hrough rows and columns, and use appropriae condions o exrac or
manipulae daa.

103.How o check wheher a web elemen is enabled or disabled wihou using isEnabled mehod?

- You can check i an elemen is enabled or disabled by using geAribue("disabled") and evaluang he value. Disabled
elemens ofen have he "disabled" aribue se.

104.Why is CSS locaor aser han XPah?

- CSS locaors are generally aser han XPah due o heir ecien implemenaon in modern browsers.

105.Even hough CSS is aser han XPah, why do 95% o companies use XPah?

- XPah oers more powerul and exible elemen selecon capabilies, especially or complex scenarios.

106.Wha should be done when an elemen is no ound, bu i's available on he web page? The elemen is no hidden, so
no need o use JavaScrip Execuor. How do you solve his?

- Veriy he locaor is accurae, check i he elemen is wihin he curren rame, and accoun or any dynamic aribues ha
may aec visibiliy.

Creaed By Eng. Shady Ahmed +201023527158


107.How do you execue ess in headless mode?

- You can run ess in headless mode by setng he browser o run wihou a visible GUI using browser opons or capabilies.

108.In Selenium, how o ge he ex value rom a ex-box i geTex() is no working?

- I geTex() doesn' work or a ex-box, you can use he geAribue("value") mehod o rerieve he ex inpu's value.

109.I we are using he correc locaor bu sll getng an "elemen no ound" error, hen how will you resolve his error?

- Ensure he elemen is wihin he curren rame, review he elemen's aribues, and use explici wais o handle
synchronizaon issues.

110.In Page Objec Model, once you creae LoginPage.java class, wha is he rs hing you sar wih wring inially? How
are you iniang wring somehing ino a page class?

- Sar by dening web elemens using @FindBy annoaons, ollowed by creang mehods o inerac wih hose elemens in
he Page Objec class.

111.Wha i a Windows popup occurs during es execuon, and due o ha, you can' execue auomaed ess? How will
you resolve his error?

- To handle Windows popups, you can use hird-pary ools like AuoIT or he Robo class in Java or ineracon wih sysem
dialogs.

112.Dieren ways o handle hidden elemens?

- Hidden elemens can be handled by using JavaScrip o manipulae heir visibiliy or by modiying heir aribues.

113.Wha is he dierence beween click() uncon in WebElemen inerace and click() uncon in Acons class?

- Boh click() uncons are used or clicking, bu he Acons class allows or more complex ineracons and is ofen used or
righ-click acons.

114.Is i possible o change he behavior o a es a runme?

- Tes behavior can be changed a runme using condional saemens, conguraons, or exernal daa sources.

115.Describe how o handle irames, windows, ables, and alers using Selenium.

- Handling hese elemens usually involves swiching o he appropriae rame/window and using WebDriver mehods or
ineracon.

Creaed By Eng. Shady Ahmed +201023527158


116.How o click he righ-click o he mouse using Selenium?

- You can perorm a righ-click using he Acons class o build and execue a righ-click acon.

117.How o scroll down a page?

- You can scroll down a page using JavaScrip by execung a scroll command hrough he WebDriver.

118.Wha will driver.geWindowHandles() reurn?

- driver.geWindowHandles() reurns a se o window handles or all open windows or abs.

119.How will you auomae Windows-based applicaons?

- For Windows-based applicaons, you can use ools like AuoIT or WinAppDriver, which provide WebDriver-like capabilies
or Windows apps.

================================================================================================

Java:
1.Why is Sring immuable in Java?

- Srings are immuable in Java because heir values canno be changed afer hey are creaed. When you modiy a
sring, a new sring is creaed insead o modiying he exisng one. This ensures ha sring objecs remain consan
and are hread-sae.

For example:

Sring original = "Hello";

Sring modied = original.conca(", World"); // This creaes a new sring

Sysem.ou.prinln(original); // "Hello" (original sring remains unchanged)

Sysem.ou.prinln(modied); // "Hello, World"

2.Wha is sac in Java?

- sac is a keyword in Java used o creae class-level variables and mehods ha belong o he class, no o insances o
he class. Sac variables are shared among all insances o he class, and sac mehods can be called wihou
creang an insance o he class.

For example:

class Example {

Creaed By Eng. Shady Ahmed +201023527158


sac in coun = 0; // Sac variable

sac void incremenCoun() { // Sac mehod

coun++;

Example.incremenCoun(); // Calling a sac mehod

Sysem.ou.prinln(Example.coun); // Accessing a sac variable

3.Wha is nal in Java?

- nal is a keyword in Java used o make variables, mehods, and classes unmodiable. When a variable is marked as
nal, is value canno be changed afer inializaon. When a mehod is declared nal, i canno be overridden in
subclasses. When a class is marked as nal, i canno be exended.

For example:

nal in x = 10; // A nal variable

nal class MyClass {} // A nal class

4.Wha is his in Java?

- his is a keyword in Java ha reers o he curren insance o he class. I is ofen used o disnguish beween
insance variables and parameers or local variables wih he same name.

For example:

class Example {

in x;

Example(in x) {

his.x = x; // "his" reers o he insance variable

}}

5.Wha is nally and where do we use i?

- nally is a block ha is used in excepon handling o ensure ha a cerain block o code is always execued, wheher
an excepon is hrown or no. I's commonly used in conjuncon wih ry and cach blocks o clean up resources.

For example:

ry {

// Code ha may hrow an excepon

Creaed By Eng. Shady Ahmed +201023527158


} cach (Excepon e) {

// Handle he excepon

} nally {

// This block always ges execued, e.g., o close a le or release resources

6.Wha is Auoboxing and unboxing?

- Auoboxing is he auomac conversion o primive daa ypes ino heir corresponding wrapper classes (e.g., in o
Ineger) when necessary. Unboxing is he opposie, where wrapper objecs are auomacally convered o heir
primive ypes.

For example:

Ineger num = 10; // Auoboxing

in value = num; // Unboxing

7.Wha is serializaon and deserializaon?

- Serializaon is he process o converng an objec's sae ino a bye sream, which can be saved o a le, sen over a
nework, or sored in a daabase.
- Deserializaon is he reverse process, where he bye sream is convered back ino an objec. This is ofen used or
daa persisence and communicaon.

8.Wha is an absrac modier?

- The absrac modier is used o declare an absrac class or mehod.


- Absrac classes canno be insanaed and are mean o be subclassed.
- Absrac mehods are declared wihou an implemenaon in he absrac class and mus be implemened by any
concree subclass.

9.Wha is call by reerence and call by value?

- In Java, all argumens are passed by value.


- When you pass an objec as an argumen, you are passing a copy o he reerence o ha objec, no he acual
objec.
- This means changes made o he objec inside he mehod aec he same objec ouside he mehod.
- However, you canno change he reerence isel.
- Primive daa ypes are passed by value, so changes inside he mehod do no aec he original value.

Creaed By Eng. Shady Ahmed +201023527158


10.Primives and Non-Primives daa ypes in Java? Sring is primive or non-primive?

- Java has primive daa ypes like in, char, and boolean, which hold simple values direcly.
- Non-primive daa ypes, ofen reerred o as reerence ypes, include classes and ineraces.
- Sring is a non-primive daa ype because i's a class ha represens a sequence o characers.

11.Wha is he mehod o overloading?

- Mehod overloading is a eaure in Java ha allows you o dene mulple mehods in he same class wih he same
name bu dieren parameer liss.
- The mehods are disnguished by he number or ype o parameers.

For example:

void prin(in x) {

// ...

void prin(Sring s) {

// ...

12.Why is i imporan o override hashCode() when you override equals()?

- When you override he equals() mehod, you're dening how wo objecs are considered equal.
- To ensure proper behavior when using hese objecs in collecons like HashMap or HashSe, you should also override
he hashCode() mehod.
- The hashCode() mehod is used o deermine he hash code o an objec, and his hash code is used o place objecs
in a hash-based daa srucure.
- I you override equals() wihou overriding hashCode(), you may encouner unexpeced behavior.

13.Wha is he dierence beween checked and unchecked excepons?

- Checked excepons are excepons ha are checked a compile me.


- They are ypically used or condions ha he programmer can ancipae and handle, such as le no ound or
nework issues.
- Unchecked excepons, also known as runme excepons, are no checked a compile me and ofen represen
programming errors, such as dividing by zero.
- Checked excepons mus be eiher caugh or declared in he mehod signaure, while unchecked excepons do no
have his requiremen.

Creaed By Eng. Shady Ahmed +201023527158


14.Dierence beween nal, nally, nalize?

- nal is a keyword used o make variables, mehods, and classes unmodiable.


- nally is a block used in excepon handling o ensure a cerain block o code is always execued.
- nalize is a mehod used or cleanup operaons on an objec beore i is garbage colleced, hough i's less commonly
used in modern Java.

15.Dierence beween absrac and inerace?

- An absrac class can have mehod implemenaons and elds, while an inerace can only declare mehod signaures
and consans.
- A class can implemen mulple ineraces, bu i can exend only one absrac class.

16.Dierence beween SringBuilder and SringBuer?

- SringBuilder is no synchronized (no hread-sae), making i more ecien or single-hreaded operaons.
- SringBuer is synchronized (hread-sae), suiable or mulhreaded operaons.
- Boh classes provide similar unconaliy or manipulang srings.

17.Dierence beween Array and ArrayLis?

- An array is a xed-size daa srucure, while an ArrayLis is a dynamic array-like daa srucure ha can grow or shrink
as needed.
- Arrays use square brackes ([]), and ArrayLis is par o he Java Collecons Framework.

18.Dierence beween ArrayLis and LinkedLis?

- ArrayLis is implemened as a dynamic array, while LinkedLis is implemened as a doubly-linked lis.


- The key dierence is in how elemens are sored and accessed.
- ArrayLis is more ecien or random access, while LinkedLis is more ecien or inserons and deleons.

19.How o dene a dynamic array?

- In Java, you can creae a dynamic array using daa srucures like ArrayLis or LinkedLis.

For Example:

impor java.ul.ArrayLis;

ArrayLis<Ineger> dynamicArray = new ArrayLis<>();

dynamicArray.add(1);

dynamicArray.add(2);

dynamicArray.add(3);

Creaed By Eng. Shady Ahmed +201023527158


20.Can we creae an objec or absrac classes?

- No, you canno creae an objec direcly or an absrac class.


- Absrac classes are mean o be subclassed, and you can only creae objecs o concree subclasses ha provide
implemenaons or all absrac mehods.

21.Can we creae an objec or an inerace?

- No, you canno creae objecs direcly rom ineraces. However, you can creae objecs o classes ha implemen he
inerace.

22.Can we creae a consrucor or an absrac class?

- Yes, you can creae consrucors or absrac classes.


- Absrac classes can have consrucors jus like any oher class.
- These consrucors can be used o inialize he elds o he absrac class or perorm oher necessary seup.

23.Can consrucors be overloaded? Explain why?

- Yes, consrucors can be overloaded in Java.


- Consrucor overloading allows you o creae mulple consrucors wih dieren parameer liss in he same class.
- This is useul when you wan o provide dieren ways o inialize an objec, caering o various scenarios.

24.Can he main mehod be overloaded?

- Yes, you can overload he main mehod in Java.


- However, only he sandard public sac void main(Sring[] args) mehod is he enry poin or running a Java
applicaon.
- Overloaded main mehods are jus like any oher mehods and need o be called explicily.

Can he main mehod be overridden?

- No, you canno override he main mehod in Java.


- The main mehod is a sac mehod and, by denion, canno be overridden.

25.Can we override a sac mehod?

- No, sac mehods canno be overridden in Java.


- They are resolved a compile-me, and he concep o polymorphism (mehod overriding) does no apply o sac
mehods.

26.Can we overload a sac mehod?

- Yes, you can overload sac mehods in Java.


- Overloading is based on he number or ypes o mehod parameers, and i is allowed or sac mehods jus as i is
or insance mehods.

Creaed By Eng. Shady Ahmed +201023527158


27.Can we wrie non-absrac mehods in an inerace?

- Sarng rom Java 8, you can wrie non-absrac mehods in an inerace using he deaul and sac keywords.
- Deaul mehods have implemenaons in he inerace, and hey can be inheried by classes ha implemen he
inerace.
-

28.Can we execue a Java program wihou he main mehod?

- No, you canno execue a Java program wihou a main mehod.


- The main mehod is he enry poin or Java applicaons, and i's required or he Java Virual Machine (JVM) o sar
he program.

29.Can we call a non-sac variable in a sac mehod?

- In a sac mehod, you canno access non-sac (insance) variables direcly.


- To access hem, you need an insance o he class.
- You can eiher creae an objec o he class or access he insance variables hrough a reerence passed o he sac
mehod.

30.Can we execue mulple cach blocks wihou ry, and will i give a compile-me error?

- No, you canno have mulple cach blocks wihou a preceding ry block.
- The ry block is essenal or excepon handling in Java.
- I is used o enclose he code ha may hrow excepons, and cach blocks are used o handle specic excepons.
- Wihou he ry block, he cach blocks have no conex, and he code will no compile.

31.How o achieve serializaon and deserializaon?

- Serializaon is achieved by implemenng he Serializable inerace in a class, and hen using ObjecOupuSream o
wrie he objec o a le or sream.
- Deserializaon is done using ObjecInpuSream o read he objec rom he le or sream.

Here's an example:

// Serializaon

ObjecOupuSream oupuSream = new ObjecOupuSream(new FileOupuSream("daa.ser"));

oupuSream.wrieObjec(objecToSerialize);

oupuSream.close();

// Deserializaon

ObjecInpuSream inpuSream = new ObjecInpuSream(new FileInpuSream("daa.ser"));

Objec deserializedObjec = inpuSream.readObjec();

inpuSream.close();

Creaed By Eng. Shady Ahmed +201023527158


32.I we declare he main mehod as privae, wha will happen?

- I you declare he main mehod as privae, he Java Virual Machine (JVM) will no be able o access i, and you won'
be able o run your Java program.
- The main mehod mus be declared as public o serve as he enry poin or your applicaon.

33.How o check wheher an array is empy and null?

- To check i an array is empy, you can use array.lengh == 0. To check i an array is null, use array == null.

Here's an example:

in[] arr = null;

i (arr == null) {

Sysem.ou.prinln("The array is null.");

} else i (arr.lengh == 0) {

Sysem.ou.prinln("The array is empy.");

} else {

Sysem.ou.prinln("The array has elemens.");

34.Wha are he classes available in a lis inerace?

- The Java Lis inerace is par o he Java Collecons Framework and provides a collecon ha holds elemens in a
sequence.
- Common implemenng classes include ArrayLis, LinkedLis, Vecor, and Sack.

35.Wha is he use o a consrucor in Java?

- Consrucors are used o inialize objecs when hey are creaed.


- They provide a way o se he inial sae and behavior o an objec.
- Consrucors are auomacally called when an objec is insanaed.

For example:

public class MyClass {

public MyClass() {

// Consrucor code o inialize he objec

Creaed By Eng. Shady Ahmed +201023527158


36.Wha is a HashMap? Can we sore objecs in HashMap, and how o rerieve hem?

- HashMap is a daa srucure in Java ha sores key-value pairs.


- You can sore objecs as values in a HashMap. To rerieve an objec, you use he associaed key.

Here's an example:

HashMap<Sring, Ineger> map = new HashMap<>();

map.pu("one", 1);

map.pu("wo", 2);

in value = map.ge("wo"); // Rerieves he value associaed wih he key "wo"

37.Dierence beween HashMap and HashSe?

- HashMap is used or key-value mapping, while HashSe is used or soring unique elemens.
- HashMap sores key-value pairs, whereas HashSe sores individual elemens wihou duplicaes.

38.Where did you use HashMap in your projec, and also OOPs conceps in your Auomaon Framework?

- you can use HashMap in various siuaons, such as caching, conguraon managemen, and managing key-value
pairs.
- Objec-Oriened Programming (OOP) conceps are ofen used in sofware developmen or creang modular and
mainainable code, including conceps like inheriance, polymorphism, encapsulaon, and absracon.

39.Access modiers in Java and heir scope?

- Access modiers conrol he visibiliy and accessibiliy o classes, elds, mehods, and consrucors in Java.

There are our main access modiers:

1- public: Accessible rom anywhere.


2- proeced: Accessible wihin he same package and in subclasses (even i hey are in dieren packages).
3- deaul (no modier): Accessible only wihin he same package.
4- privae: Accessible only wihin he same class.

40.Wha is mean by a Thread?

- A hread is he smalles uni o a process ha can run concurrenly in a program.
- In Java, you can creae and manage hreads using he Thread class or he Runnable inerace.
- Threads are used or concurren execuon and parallel processing.

Creaed By Eng. Shady Ahmed +201023527158


41.Wha is a singleon class in Java?

- A singleon class is a class ha allows only one insance o isel o be creaed.
- I ofen includes a privae consrucor and a mehod o ge he insance.
- This ensures ha here's only one insance o he class hroughou he program.

42.Wha is he dierence beween sac binding and dynamic binding?

- Sac binding (also known as early binding) occurs during compile-me.


- The compiler deermines which mehod o call based on he reerence ype.
- Dynamic binding (also known as lae binding) occurs during runme.
- The mehod o be execued is deermined based on he acual objec ype a runme. I's associaed wih mehod
overriding in Java.

43.Is HashMap hread-sae?

- No, HashMap is no hread-sae by deaul.


- I you need hread saey, you can use ConcurrenHashMap or synchronize access o a regular HashMap using exernal
synchronizaon.

44.Wha is sac, and how o se he value o a sac variable?

- A sac variable belongs o he class raher han o any specic insance.
- You can se he value o a sac variable by direcly reerencing he class name and using he assignmen operaor,

or example:

MyClass.sacVariable = 10; // Setng he value o a sac variable

45.Can we overload privae mehods?

- Yes, you can overload privae mehods in Java as long as hey are wihin he same class.
- Overloading is based on he mehod's parameer lis, and access modiers do no aec overloading.

46.Is i possible o exend a nal class?

- No, i’s no possible o exend a nal class in Java. A nal class canno be subclassed.

47.Is i possible o override a sac mehod?

- No, i's no possible o override a sac mehod in Java.


- Sac mehods are bound a compile-me and canno be overridden.

Creaed By Eng. Shady Ahmed +201023527158


48.Is i possible o overload he main mehod?

- Yes, i's possible o overload he main mehod by dening mulple main mehods wih dieren parameer liss.
- However, only he sandard public sac void main(Sring[] args) mehod is used as he enry poin or he Java
applicaon.

49.Is i possible o inialize a variable presen in an inerace?

- In Java, inerace elds are implicily public, sac, and nal, and hey mus be inialized when declared.
- You can' inialize hem laer in he implemenng class.

50.Wha would happen i mulple inheriance is possible in Java?

- Java does no suppor mulple inheriance or classes. However, i suppors mulple inheriance or ineraces.
- I mulple inheriance or classes were possible, i could lead o he "diamond problem," where ambiguiy arises i a
class inheris rom wo classes wih he same mehod names.
- Java avoids his issue by allowing mulple inheriance hrough ineraces only.

51.Explain he excepons hierarchy in Java?

- In Java, all excepons inheri rom he Throwable class.


- The wo main caegories are:
1- Checked excepons: These mus be eiher caugh using ry-cach or declared in he mehod's signaure.
2- Unchecked excepons (runme excepons): These do no need o be explicily caugh or declared.

52.Explain Se and Map in Java?

- Ses and Maps are par o he Java Collecons Framework:


- Se: A se is a collecon ha does no allow duplicae elemens.
- Common implemenaons include HashSe, LinkedHashSe, and TreeSe.

- Map: A map is a collecon o key-value pairs.


- Each key is associaed wih exacly one value.
- Common implemenaons include HashMap, LinkedHashMap, and TreeMap.

53.Explain abou Inheriance.

- Inheriance is one o he our undamenal conceps in Objec-Oriened Programming (OOP).


- I allows a class (subclass or derived class) o inheri he properes and behaviors o anoher class (superclass or base
class).
- Inheriance promoes code reusabiliy and esablishes an “is-a” relaonship beween classes.

Creaed By Eng. Shady Ahmed +201023527158


54.Dierence beween overloading and overriding?

- Overloading: I involves dening mulple mehods in he same class wih he same name bu dieren parameer
liss. Overloaded mehods have he same name bu dieren signaures.
- Overriding: I occurs when a subclass provides a specic implemenaon or a mehod dened in is superclass. The
mehod in he subclass has he same name, reurn ype, and parameer lis.

55.Dierence beween Encapsulaon and Absracon?

- Encapsulaon: Encapsulaon is he concep o wrapping daa (aribues) and he code (mehods) ha operaes on
ha daa ino a single uni, known as a class. I hides he inernal sae o an objec and provides conrolled access via
access modiers.
- Absracon: Absracon is he process o simpliying complex realiy by modeling classes based on heir essenal
characeriscs. I hides he complex implemenaon deails and ocuses on dening a clear inerace or conrac.

56.Dierence beween hrow and hrows?

- hrow: Used o explicily hrow an excepon wihin a mehod or block o code.


- hrows: Used in a mehod's declaraon o speciy ha he mehod migh hrow cerain excepons and ha he caller
should handle or propagae hose excepons.

57.Wha is polymorphism?

- Polymorphism is a undamenal concep in OOP, which means "many shapes."


- I allows objecs o dieren classes o be reaed as objecs o a common superclass.
- Polymorphism enables mehod overriding and dynamic mehod dispach, allowing dieren classes o provide heir
implemenaons o he same mehod.

58.How and when o use an inerace?

- Ineraces in Java are used o dene a conrac o mehods ha implemenng classes mus adhere o.
- They are useul when you wan o ensure ha mulple classes provide specic unconalies while allowing or
exibiliy in he implemenaon.
- Ineraces suppor mulple inheriance in Java, as a class can implemen mulple ineraces.

59.Can we insanae an inerace?

- No, you canno creae an insance (objec) o an inerace in Java.


- Ineraces are mean o be implemened by classes, and objecs can be creaed rom hose implemenng classes.

60.Can we overload he main mehod in Java?

- Yes, you can overload he main mehod in Java by providing dieren parameer liss.
- However, only he sandard public sac void main(Sring[] args) mehod is recognized as he enry poin or your
applicaon.

Creaed By Eng. Shady Ahmed +201023527158


61.Can we override a consrucor?

- Consrucors canno be overridden in Java. Consrucors are no inheried and canno be called by subclasses.

62.Where do you use polymorphism in Java?

- Polymorphism is used in various siuaons, including mehod overriding, dynamic mehod dispach, and designing
generic and exensible code.
- I allows you o work wih objecs o dieren classes hrough a common inerace or superclass.

63.Wha is Sysem.ou.prinln() and is use?

- Sysem.ou.prinln() is a mehod used o prin oupu o he console in Java.


- I's par o he Sysem class and is ofen used or debugging and displaying messages o he console.

64.Why do we use nally, and how does i dier rom he nal keyword?

- The nally block is used in excepon handling o ensure ha a cerain block o code is always execued, wheher an
excepon is hrown or no.
- I's unrelaed o he nal keyword, which is used or declaring consans and making classes, mehods, or variables
unmodiable.

65.Can we use mulple cach blocks? When can we use mulple cach blocks?

- Yes, you can use mulple cach blocks in a ry-cach saemen o handle dieren ypes o excepons.
- The cach blocks are evaluaed in order, and he rs maching block is execued.

66.Dierence beween POI and JXL?

- Apache POI and JXL are Java libraries used or working wih Excel les.
- POI is more eaure-rich, supporng boh reading and wring Excel les (XLS and XLSX), while JXL primarily suppors
reading older Excel les (XLS).

67.How o preven he override mehod in Java?

- To preven a mehod rom being overridden in a subclass, mark he mehod wih he nal keyword.
- This prevens subclasses rom providing heir implemenaons or ha mehod.

68.Why is he main mehod sac?

- The main mehod is sac because i needs o be accessible and called wihou creang an insance o he class.
- I serves as he enry poin or he Java applicaon, and sac mehods can be called using he class name.

Creaed By Eng. Shady Ahmed +201023527158


69.Wha is he use o sac variables?

- Sac variables are shared among all insances o a class.


- They are used o sore values ha are common o all objecs o he class, such as consans, couners, or shared
conguraon setngs.

70.Wha is he dierence beween Lis and Se?

- Lis is an ordered collecon ha allows duplicae elemens.


- Se is an unordered collecon ha does no allow duplicae elemens.
- Boh are par o he Java Collecons Framework.

71.How will you access deaul and proeced class?

- Deaul (package-privae) and proeced access are handled dierenly:


- Deaul: Classes and members wih deaul access can be accessed only wihin he same package.
- Proeced: Classes and members wih proeced access can be accessed wihin he same package and by subclasses,
wheher hey are in he same package or a dieren package.

72.Why is objec creaon no possible in absrac classes?

- Objec creaon is no possible in absrac classes because absrac classes are incomplee and mean o be
subclassed.
- They can conain absrac mehods ha have no implemenaon.
- To creae an objec, you need a concree class ha provides implemenaons or all mehods.

73.Design paerns in JAVA.

- Design paerns in Java are esablished soluons o common sofware design problems.
- Some popular design paerns include Singleon, Facory, Observer, Sraegy, and Decoraor, among ohers.
- These paerns provide reusable and mainainable soluons o common archiecural and design challenges.

74.Wha do all he classes in he Java Collecon Framework have?

- All classes in he Java Collecon Framework implemen he java.ul.Collecon inerace.
- This inerace denes a common se o mehods or working wih collecons, such as add, remove, size, and ieraor.

Creaed By Eng. Shady Ahmed +201023527158


75.Siuaons when we use absracon and Inerace - explanaon abou loosely coupled and ghly coupled.

- Absracon and ineraces are undamenal conceps in sofware design ha promoe modular, mainainable, and
loosely coupled code:
- Absracon is he process o simpliying complex sysems by modeling classes based on heir essenal characeriscs.
In objec-oriened programming (OOP), absracon involves dening classes ha capure he mos crical aribues
and behaviors o real-world objecs, while hiding unnecessary deails.

- Ineraces are a key ool or achieving absracon in Java. They dene a conrac or a se o mehods wihou
providing heir implemenaons. This conrac allows dieren classes o provide heir own implemenaons while
adhering o he same inerace. I promoes code consisency and suppors polymorphism.

76.Loosely Coupled and Tighly Coupled:

- Loosely Coupled code is modular and has minimal dependencies beween is componens. Each module or class
operaes independenly, and changes in one module do no require changes in many oher modules. Loosely coupled
code is more exible and easier o mainain.
- Tighly Coupled code has srong dependencies beween is componens. Changes in one componen can have a
cascading eec on many oher componens, making he code less exible and harder o mainain.

77.Absracon and Ineraces in Relaon o Coupling:

- Absracon, when applied eecvely, can reduce coupling.


- By absracng complex behaviors and ineracons ino well-dened ineraces, you creae a clear separaon o
concerns and reduce dependencies beween classes.

- Ineraces play a crucial role in achieving loose coupling.


- When classes depend on ineraces raher han concree implemenaons, you creae a level o indirecon. This
allows you o swap ou dieren implemenaons wihou aecng he dependen classes.

For example, le's say you have a NotcatonService inerace wih mehods like sendEmail and sendSMS. Multple classes can
implemen his inerace, providing dieren ways o send notcatons (e.g., hrough email, SMS, or a mobile app). Classes
ha need o send notcatons depend on he inerace, no he specic implemenaton, making he sysem more fexible and
less tghly coupled.

- Loose coupling is a key principle in achieving mainainable and exensible sofware, and absracon hrough
ineraces is a powerul echnique o help achieve his goal.

Creaed By Eng. Shady Ahmed +201023527158


78.Will Java provide a deaul consrucor by isel? How?

- Java provides a deaul (no-argumen) consrucor or a class only i you haven' explicily dened any consrucors or
ha class.
- I you provide any consrucor (wih or wihou argumens) in your class, Java will no creae a deaul consrucor or
you.

79.Dierence beween ArrayLis and LinkedLis, and in which siuaons hey are used?

- ArrayLis:
1- Implemens a dynamic array.
2- Provides as random access (O(1)) and slower inseron/deleon (O(n) or shifing elemens).
3- Suiable when you need as access and less requen inserons/deleons.

- LinkedLis:
1- Implemens a doubly-linked lis.
2- Provides as inseron/deleon (O(1)) and slower random access (O(n)).
3- Suiable when you need requen inserons/deleons and don' require as random access.

Choose beween ArrayLis and LinkedLis based on your specic use case and he ype o operatons you'll be perorming
requenly.

80.Dierence beween Lis<Sring> lis = new ArrayLis<Sring>() and ArrayLis<Sring> lis = new ArrayLis<Sring>()?

- Lis<Sring> lis = new ArrayLis<Sring>() uses he inerace Lis o reerence an ArrayLis.
- This is ofen recommended because i allows or exibiliy in case you wan o change he implemenaon o anoher
Lis implemenaon (e.g., LinkedLis) wihou modiying your code signicanly.

- ArrayLis<Sring> lis = new ArrayLis<Sring>() explicily uses he ArrayLis class o reerence an ArrayLis.
- This binds your code o he specic implemenaon, which may no be as exible i you decide o change o a
dieren lis ype laer.

81.Dierence beween HashMap and MulMap?

- HashMap is a daa srucure in Java ha sores key-value pairs, where each key maps o a single value.
- MulMap, on he oher hand, is no par o he Java sandard library.
- I ypically reers o a daa srucure ha allows one key o map o mulple values.
- Libraries like Apache Commons Collecons provide a MulMap implemenaon.
- In a MulMap, you can associae mulple values wih a single key.

Creaed By Eng. Shady Ahmed +201023527158


82.In which siuaon should a mehod be sac and when non-sac?

Sac Mehod:

- Use sac mehods when he behavior o he mehod is no dependen on he sae o he insance (i.e., i doesn'
access insance-specic daa).
- Use sac mehods or uliy mehods, consans, or mehods ha can be invoked using he class name wihou
creang an insance.

Non-Sac Mehod:

- Use non-sac (insance) mehods when he behavior o he mehod depends on he sae or elds o an insance.
- Use non-sac mehods or operaons specic o individual objecs or when he mehod needs access o insance
daa.

83.How does a HashMap work using key-value pairs?

- A HashMap uses a hash able o sore key-value pairs.


- When you pu a key-value pair ino a HashMap, he key is hashed o calculae he index in he underlying array where
he value should be sored.
- The hash code is used o deermine he index, and i wo keys produce he same hash code (a collision), hey are
sored in he same index using a daa srucure like a linked lis or a ree.

When you wan o rerieve a value by key, he key is hashed again, and he index is calculaed. The HashMap navigaes o ha
index and searches he linked lis or ree (i needed) o nd he maching key and reurn he associaed value.

84.I you have a class and an absrac class, and he class has a user-dened consrucor and a main mehod, which one will
ge execued rs?

- In Java, when you run a program, he main mehod is he enry poin o he applicaon.
- I will be execued rs. Consrucors are called when you creae an insance o a class, bu he main mehod is he
sarng poin or your program.

85.Wha is a POJO, and why do we use POJO?

- POJO sands or "Plain Old Java Objec." I reers o a Java class ha adheres o simple convenons: i has privae
elds, public geer and seer mehods, and oponal consrucors.
- POJOs are used or simpliciy, ease o mainenance, and o represen daa in a clean and sandardized way.
- They are ofen used or daa sorage and ranser, especially in rameworks like JavaBeans, Hibernae, or Spring.

86.Class A has 3 mehods, Class B has 2 mehods, and Class B inheris rom Class A. How do you call a mehod o Class A by
creang an objec o Class B?

- I Class B inheris rom Class A, you can creae an objec o Class B and call he mehods o Class A using he objec o
Class B. This is achieved hrough inheriance.

For example:

Creaed By Eng. Shady Ahmed +201023527158


public class A {

public void mehodA() {

Sysem.ou.prinln("Mehod in Class A");

public class B exends A {

public void mehodB() {

Sysem.ou.prinln("Mehod in Class B");

public class Main {

public sac void main(Sring[] args) {

B objB = new B();

objB.mehodA(); // Call mehodA rom Class A

objB.mehodB(); // Call mehodB rom Class }}

API
Queson 1: Dierence beween REST and SOAPUI?

- REST (Represenaonal Sae Transer) and SOAPUI (Simple Objec Access Proocol User Inerace) are wo dieren
approaches or designing web services.
- REST is an exile and rapid archiecural syle ha uses sandard HTTP mehods and is ypically based on resources
and allow daa exchange in mulple ormas such as JSON (JavaScript Object Notation)
- SOAP is highly srucured approach or API design which using XML(Extensible Markup Language) daa orma.
- SOAPUI is a ool used or esng SOAP-based web services.

Queson 2: Wha are he common HTTP mehods in REST?

REST uses several HTTP mehods, including:

- GET: Rerieve daa.


- POST: Creae a new resource.
- PUT: Updae an exisng resource (replace i).
- PATCH: Paral updae o a resource.
- DELETE: Remove a resource.

Creaed By Eng. Shady Ahmed +201023527158


Queson 3: Wha's he dierence beween PUT and PATCH calls in REST?

- PUT is used o replace he enre resource,


- PATCH is used o make paral updaes o a resource.
- Wih PUT, you provide a complee represenaon o he resource,
- while wih PATCH, you only provide he elds ha need o be updaed.

Queson 4: How can you inegrae Posman ino a projec?

- Posman can be inegraed ino a projec by creang collecons o API requess, organizing hem, and sharing hem
wih eam members.
- You can impor/expor collecons and use Posman's eaures or auomaed esng and monioring.

Queson 5: How do you handle dynamic payloads in API esng?

- You can use variables in Posman o handle dynamic payloads.

For example, you can use environmen variables o sore and reuse values rom one reques o anoher.

Queson 6: How do you capure specic response values and pass hem o oher requess in Posman?

- In Posman, you can capure specic response values by using JavaScrip ess and se hem as variables o use in
subsequen requess.

Queson 7: Wha challenges have you aced in API esng?

- Challenges in API esng can include handling auhencaon, managing dynamic daa, esng dieren reques
mehods, and ensuring securiy.

Queson 8: Wha's he dierence beween Auhorizaon and Auhencaon?

- Auhencaon veries a user's ideny,


- while auhorizaon deermines wha ha auhencaed user is allowed o do.

For example, logging ino a sysem is auhencaon, and accessing specic resources wihin ha sysem is auhorizaon.

Queson 9: Wha are some common HTTP saus codes you have come across in API esng?

Some common HTTP saus codes include:

- 200 (OK): Successul reques.


- 201 (Creaed): Resource creaed.
- 400 (Bad Reques): Invalid reques.
- 401 (Unauhorized): Auhencaon required.

Creaed By Eng. Shady Ahmed +201023527158


- 403 (Forbidden): Access denied.
- 404 (No Found): Resource no ound.
- 500 (Inernal Server Error): Server issues.

Queson 10: Wha's he dierence beween OAuh 1.0 and OAuh 2.0, when and where do you use hem, and can you
provide a sample code or OAuh 2.0?

- OAuh 1.0 and OAuh 2.0 are dieren versions o he OAuh proocol.
- OAuh 2.0 is more widely used and oers improvemens in securiy and simpliciy.

You ypically use OAuh 2.0 or modern applicaons.

Queson 11: How do you ge a response rom one API and send i o anoher API?

- You can achieve his by exracng daa rom he response o one API reques in Posman and hen using ha daa as
variables in subsequen requess.
- This is ofen done using Posman's scripng capabilies.

TesNG (New Generaon)


1.Wha is he imporance o he TesNG ramework?

- TesNG is imporan or es auomaon because i provides a powerul ramework or wring and running es cases.
- I allows you o dene es suies, run ess in parallel, and provides deailed reporng.

2.Why do we use TesNG in your ramework?

- TesNG is used or is exibiliy and eaures like es grouping, parallel es execuon, and comprehensive reporng.

3.Wha is he purpose o esng XML?

- TesNG XML les are used o congure and organize es suies, se parameers, and dene es dependencies.

4.Explain he purpose o liseners, and is i a Selenium concep or TesNG concep?

- Liseners are par o TesNG, no Selenium.


- They allow you o cusomize es execuon and capure evens such as es success or ailure.
- Liseners are used or asks like logging, reporng, and aking screenshos.

Creaed By Eng. Shady Ahmed +201023527158


5.Case Scenario: How o run he same mehod 100 mes in TesNG wih he same daa?

- You can use he @DaaProvider and invocaonCoun aribues o run he same es mehod wih he same daa
mulple mes.

Here's an example:
@Tes(daaProvider = "daa-provider")

public void esMehod(Sring daa) {

Sysem.ou.prinln("Daa: " + daa);

@DaaProvider(name = "daa-provider")

public Objec[][] daaProviderMehod() {

Objec[][] daa = new Objec[100][1];

or (in i = 0; i < 100; i++) {

daa[i][0] = "Tes Daa " + i;

reurn daa;}

6.Wha is he reporng ool in your ramework, and why do you use i?

- Reporng ools like ExenRepors or Allure are ofen used in conjuncon wih TesNG o generae deailed and user-
riendly es repors.
- These ools make i easier o undersand es resuls.

7.Wha are dieren TesNG annoaons?

Common TesNG annoaons include

- @Tes,
- @BeoreMehod,
- @AferMehod,
- @BeoreTes,
- @AferTes,
- @BeoreClass,
- @AferClass,
- @BeoreSuie,
- @AferSuie.

Each serves a specic purpose in es execuon.

8.How can you congure ess in TesNG?

- Tess are congured in TesNG XML les where you dene suies, ess, classes, mehods, parameers, and daa
providers.

Creaed By Eng. Shady Ahmed +201023527158


9.Wha is @DaaProvider?

- @DaaProvider is a TesNG annoaon used o provide daa o es mehods.


- I allows you o separae es daa rom es logic.

Here's an example:

@DaaProvider(name = "daa-provider")

public Objec[][] daaProviderMehod() {

reurn new Objec[][] {

{"Daa1", "Resul1"},

{"Daa2", "Resul2"},

// Add more daa here

};

10.Dierence beween @Facory and @DaaProvider.

- @Facory is used o run mulple es classes,


- @DaaProvider is used o supply daa o a es mehod.
- They serve dieren purposes.
- @Facory is used o run he same es class mulple mes wih dieren daa ses.

For example, i you have a es class MyTes and you wan o run i wih dieren daa ses, you can creae a acory
mehod o insanae i mulple mes wih dieren daa.

11.Wha Tes Order in TesNG?

- By deaul, TesNG runs es mehods in lexicographic order (i.e., he order in which hey appear in he class).
- You can use prioriy aribues, such as @Tes(prioriy = 1), o conrol he execuon order.

12.How o add/remove es cases in Tesng.xml?

- To add or remove es cases in a TesNG XML le, you can simply edi he XML le direcly.
- Add or remove <class> or <mehod> elemens wihin he <es> ags o include or exclude es cases.

13.Explain he dierence beween @BeoreMehod, @BeoreTes, and @BeoreClass.

These annoaons are par o TesNG's seup phase:

- @BeoreMehod: Execued beore each es mehod wihin a class.


- @BeoreTes: Execued beore any es mehods in a <es> ag.
- @BeoreClass: Execued once beore any es mehods in a class.

Creaed By Eng. Shady Ahmed +201023527158


14.Lis ou he TesNG annoaon hierarchy order:

The hierarchy order is:

- @BeoreSuie
- @BeoreTes
- @BeoreGroups
- @BeoreClass
- @BeoreMehod
- @Tes
- @AferMehod
- @AferClass
- @AferGroups
- @AferTes
- @AferSuie

15.How do you achieve parallel execuon using TesNG?

- You can achieve parallel execuon in TesNG by setng he parallel aribue in he TesNG XML le.

For example:

<suie name="MyTesSuie" parallel="mehods">

16.Ou o 50 es cases, how do you run only he ailed es cases?

- You can rerun ailed es cases by using TesNG's IInvokedMehodLisener and TesNG's IAnnoaonTransormer
- You would need o implemen cusom logic o ideny and rerun ailed ess.

17.How can you ake a screensho or he ailed es cases?

- You can capure screenshos or ailed es cases by implemenng a cusom lisener ha uses Selenium WebDriver's
screensho capabilies.
- When a es ails, he lisener can capure he screensho and save i.

18.How can you run he same ess or 10 mes?

- You can use he invocaonCoun aribue in TesNG o run he same es mehod mulple mes. For example:

@Tes(invocaonCoun = 10)

public void myTes() {

// Tes logic here

Creaed By Eng. Shady Ahmed +201023527158


19.Types o Liseners:

- TesNG provides various liseners like IInvokedMehodLisener, ITesLisener, ISuieLisener, ec.


- These can be used o cusomize es execuon and reporng.

20.TesNG: Parallel execuons, Grouping?

- TesNG suppors parallel execuon o ess by using he parallel aribue in he XML le.
- Grouping is a way o caegorize and run ess ha belong o specic groups.

21.Dierence beween @AferSuie and @BeoreSuie.

- @AferSuie runs afer all es suies in he XML le have compleed,
- @BeoreSuie runs beore any es suies sar.

22.Wha is he use o TesNG XML?

- TesNG XML les are used or conguraon, grouping o es cases, parallel execuon, and speciying es
dependencies.

23.How many suies can be here in TesNG, and wha happens i you run all he suies?

- You can have mulple suies in a TesNG XML le.


- I you run all he suies, TesNG will execue all he es suies sequenally.

Synax o perorm parallel esng in TesNG, including he parallel aribue:

To run mehods in parallel, you can se he parallel aribue in your suie XML le like his:

<suie name="MyTesSuie" parallel="mehods">

24.Can you have mulple suies in one XML le, and wha i you wan o run all suies?

- Yes, you can have mulple suies in one XML le.


- To run all suies, you simply speciy he name o he XML le when running TesNG.

25.Wha is invocaonCoun in TesNG?

- invocaonCoun species how many mes a es mehod should be invoked or run.

Creaed By Eng. Shady Ahmed +201023527158


26.Cucumber ags and annoaons?

- Cucumber uses ags o group and caegorize scenarios.


- Annoaons in Cucumber are used o dene seps and hooks.
- Common annoaons include @Given, @When, @Then, @And, and @Bu.

27.Wha is background in Cucumber?

- The Background keyword in Cucumber is used o dene a se o seps ha are common o mulple scenarios.
- These seps are execued beore each scenario.

28.Dierence beween Scenario and Scenario Ouline in Cucumber?

- Scenario is used or a single example,


- Scenario Ouline is used o creae a emplae or mulple examples using placeholders (e.g., <placeholder>).

29.Wrie he skeleon o a Cucumber es runner:

- A Cucumber es runner ypically looks like his:

@RunWih(Cucumber.class)

@CucumberOpons(

eaures = "src/es/resources/eaures",

glue = "com.example.seps"

public class CucumberTesRunner {

30.Explain he rery analyzer in TesNG:

- A rery analyzer in TesNG is a cusom class ha implemens IReryAnalyzer.


- I allows you o speciy how many mes a es mehod should be reried when i ails.

31.Cucumber ags and running dieren combinaons o ags:

- You can run dieren combinaons o Cucumber ags by speciying hem in he es runner class or using he
command line wih --ags.

Creaed By Eng. Shady Ahmed +201023527158


32.Dierence beween hooks and ags in Cucumber:

- Hooks are blocks o code ha run beore or afer each scenario.
- Tags are used o caegorize and ler scenarios or execuon based on specic crieria.

Maven
Queson 1: Liecycle o Maven

- The Maven liecycle consiss o a sequence o phases ha dene he build process.
- The deaul liecycle includes phases like compile, es, package, insall, and deploy.
- Developers can bind heir goals o hese phases in he pom.xml le o auomae he build process.

Example:

<build>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<aracId>maven-compiler-plugin</aracId>

<version>3.8.1</version>

<conguraon>

<source>1.8</source>

<arge>1.8</arge>

</conguraon>

</plugin>

</plugins>

</build>

Queson 2: Use o Maven Surere Plugin

- The Maven Surere Plugin is used or running ess.


- I's congured in he pom.xml le o execue uni ess during he es phase.
- I's essenal or auomaed esng.

Example:
<build>

<plugins>

Creaed By Eng. Shady Ahmed +201023527158


<plugin>

<groupId>org.apache.maven.plugins</groupId>

<aracId>maven-surere-plugin</aracId>

<version>2.22.0</version>

<conguraon>

<includes>

<include>**/*Tes.java</include>

</includes>

</conguraon>

</plugin>

</plugins> </build>

Queson 3: Wha is he use o pom.xml?

- The pom.xml (Projec Objec Model) is a undamenal conguraon le in a Maven projec.
- I denes he projec's srucure, dependencies, build process, and plugins. I's used o manage he projec's build and
dependencies.

Example:

<projec>

<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>

<aracId>my-projec</aracId>

<version>1.0.0</version>

<!-- Dependencies, plugins, and build conguraon -->

</projec>

Queson 4: CI/CD ools

- Connuous Inegraon (CI) and Connuous Deploymen (CD) ools auomae he build, es, and deploymen
processes.

Examples include Jenkins, Travis CI, GiLab CI/CD, and CircleCI.

Queson 5: Wha is Jenkins?

- Jenkins is an open-source auomaon server used or building, esng, and deploying code.
- I provides a way o auomae sofware developmen and is ofen used in CI/CD pipelines.

Creaed By Eng. Shady Ahmed +201023527158


Queson 6: How will you handle dependencies in Maven a runme?

- Maven handles dependencies a runme by downloading he required libraries and resources rom reposiories
specied in he pom.xml le.
- These dependencies are eched rom cenral reposiories and cached locally.

Queson 7: Handling Deleed Dependencies in .pom File

- I someone delees dependencies rom he pom.xml le, you won' be able o execue ess or he missing
dependencies.
- I's crucial o keep he pom.xml le up o dae o ensure all required dependencies are available.

Queson 8: Wring Tess/Suies or Dieren Environmens using Maven

- You can use Maven proles o dene environmen-specic conguraons and pass dieren daa or each
environmen. Proles are dened in he pom.xml le.

Example:

<proles>

<prole>

<id>qa</id>

<properes>

<environmen>qa</environmen>

</properes>

</prole>

<prole>

<id>preproducon</id>

<properes>

<environmen>preproducon</environmen>

</properes>

</prole>

<!-- Add more proles or oher environmens -->

</proles>

Creaed By Eng. Shady Ahmed +201023527158


Queson 9: Basic Maven Commands

- mvn clean: Cleans he projec.


- mvn compile: Compiles he projec.
- mvn es: Runs ess.
- mvn package: Packages he applicaon.
- mvn insall: Insalls he arac in he local reposiory.
- mvn deploy: Deploys he arac o a remoe reposiory.

Queson 10: Conguring a Jenkins Job

- To congure a Jenkins job, you need o creae a new job, speciy he build seps, se build riggers (e.g., SCM changes),
and congure pos-build acons (e.g., es repors and deploymens).

Queson 11: Jenkins Inegraon

- Jenkins is inegraed wih various ools and services, including version conrol sysems (e.g., Gi), build ools (e.g.,
Maven), and deploymen plaorms (e.g., Docker, AWS).

Queson 12: Scheduling Deploymens

- Jenkins allows you o schedule deploymens by conguring build jobs o run a specic mes or in response o evens
like code commis.

Queson 13: Purpose o Version Conrol Tool

- Version conrol ools like Gi are used o rack and manage changes o source code.
- They provide version hisory, collaboraon, and code inegriy.

Queson 14: Gi Commands Used

Common Gi commands include :

- gi ini,
- gi clone,
- gi add,
- gi commi,
- gi push,
- gi pull,
- and gi merge.

Queson 15: Dierence beween Group ID and Arac ID

Creaed By Eng. Shady Ahmed +201023527158


- Group ID: I idenes he group or organizaon o which he projec belongs.
- Arac ID: I species he name o he projec or module.

Queson 16: Jenkins Usage in Auomaon

- Jenkins is used in auomaon or building, esng, and deploying applicaons in connuous inegraon and
connuous deploymen (CI/CD) pipelines.
- I auomaes he developmen and deploymen processes.

Agile
Queson 1: Wha is an Agile Mehodology?

- Agile is an ierave and incremenal approach o sofware developmen.


- I emphasizes collaboraon, cusomer eedback, and he abiliy o respond o changing requiremens.
- Agile mehodologies, such as Scrum and Kanban, ocus on delivering working sofware in small, requen incremens.

Queson 2: Wha is Scrum, and Who is Your Scrum Maser?

- Scrum is a specic Agile ramework or managing complex knowledge work.


- I includes roles like Produc Owner, Scrum Maser, and Developmen Team.
- The Scrum Maser is a aciliaor and coach, responsible or ensuring he Scrum process is ollowed.

Queson 3: Ceremonies Followed in Agile Mehodology

Agile ceremonies(Meengs) include:

- Sprin Planning: The eam plans he work or he upcoming sprin.
- Daily Sandup: A brie daily meeng or eam members o discuss progress and obsacles.
- Sprin Review: A demo o he compleed work in he sprin.
- Sprin Rerospecve: A meeng o reec on wha wen well and wha could be improved.

Queson 4: Rerospecve Meeng

- A rerospecve meeng, held a he end o each sprin, is an Agile ceremony or he eam o reec on heir work.
- The goal is o ideny wha wen well and wha could be improved in he nex sprin.
- The eam discusses processes, communicaon, and acons o ake or improvemen.

Creaed By Eng. Shady Ahmed +201023527158


Queson 5: Describe Scrum Ceremony

- Scrum ceremonies include Sprin Planning, Daily Sandup, Sprin Review, and Sprin Rerospecve.
- These meengs provide a srucured ramework or planning, communicaon, and improvemen in Agile projecs.

Queson 6: When Do You Auomae in he Curren Sprin or Nex Sprin?

- In Agile, auomaon should ideally be par o he Denion o Done (DoD) or user sories.
- Tes auomaon should be done in he same sprin as he developmen.
- However, i auomaon work is subsanal, i migh spill over o he nex sprin bu should be a prioriy.

Queson 7: Explain Velociy in Sprin

- Velociy is a measure o he amoun o work a Scrum eam can complee in a sprin.
- I's usually represened in sory poins or ideal days.
- Velociy helps in predicng how much work can be done in uure sprins and is used or sprin planning.

Queson 8: Handling New Requiremens in a Tigh Sprin Schedule

- In a gh sprin schedule, new requiremens should be careully evaluaed.


- I a requiremen is crical, i can be considered or he curren sprin, bu i migh impac he sprin scope.
- Alernavely, he new requiremen can be added o he backlog and considered or he nex sprin afer proper
evaluaon.

Queson 9: Wha is Backlog in Scrum Mehodology?

- A backlog in Scrum is a priorized lis o user sories and asks ha need o be developed in uure sprins.
- I includes he Produc Backlog (long-erm goals) and he Sprin Backlog (work o be done in he curren sprin).

Queson 10: Designing and Running Tes Scrips in a Release wih 30+ Sprins

- In a long release wih many sprins, i's essenal o mainain es scrip version conrol and auomaon inrasrucure.
- Tes scrips should be organized, modular, and well-documened.
- Tes execuon should align wih sprin goals, and regression esng should be auomaed o ensure previous
unconaliy remains inac.

Queson 11: Wha dierence beween burn up and burn down in agile?

In Agile projec managemen, "burn up" and "burn down" chars are used o rack he progress o work in a visual manner.
Boh chars are helpul in monioring he compleon o work iems, bu hey represen he daa in dieren ways.

Here are he key dierences beween "burn up" and "burn down" chars in Agile:

Creaed By Eng. Shady Ahmed +201023527158


1. Represenaon:
- Burn Down Char: A burn down char represens he remaining work (usually in sory poins, asks, or hours) over
me. I sars a he oal scope o work o be done and gradually decreases o zero as work is compleed. The line
"burns down" rom he op o he boom.
- Burn Up Char: A burn up char, on he oher hand, shows he oal work compleed over me. I sars a zero and
increases as work is compleed. The line "burns up" rom he boom o he op.

2. Focus:
- Burn Down Char: A burn down char ocuses on how much work is remaining and wheher he eam is on rack o
complee he scope by he end o he sprin or release. I helps in idenying scope changes, delays, or overages.
- Burn Up Char: A burn up char ocuses on how much work has been compleed, giving a clear view o he progress
oward ullling he projec's scope. I helps in undersanding he cumulave eor expended.

3. Scope Changes:
- Burn Down Char: In a burn down char, scope changes or he addion o new work can make i more challenging o
assess progress, as i doesn' inherenly show he eec o scope changes.
- Burn Up Char: A burn up char handles scope changes more graceully, as i connues o show he progress made
despie scope changes.

4. Ease o Use:
- Burn Down Char: Burn down chars are ofen simpler o creae and inerpre because hey ocus on a single meric –
he remaining work.
- Burn Up Char: Burn up chars are slighly more complex o consruc and undersand, as hey represen boh
compleed work and poenally scope changes.

Funconal Tesng:
Queson 1: Wha is a Tes Plan?

A es plan is a comprehensive documen ha oulines he approach, scope, resources, schedule, and deliverables or a
esng projec. I denes he es objecves, sraegies, enry and exi crieria, and es deliverables.

Queson 2: Explain he Bug Lie Cycle?

- The bug lie cycle consiss o sages such as "New," "Assigned," "Open," "Fixed," "Veried," and "Closed."
- A bug sars in he “New” sae when repored, goes hrough vericaon, and is closed when i’s resolved. Each sae
has specic acons and responsibilies.

Creaed By Eng. Shady Ahmed +201023527158


Queson 3: Dierence beween Smoke and Saniy Tess?

- Smoke Tesng: Smoke ess ensure ha he crical unconalies o he sofware are working beore urher esng.
I’s a broad es o check i he applicaon can be considered or more in-deph esng.
- Saniy Tesng: Saniy ess ocus on specic areas or componens o he sofware o veriy ha parcular changes or
xes have no adversely impaced relaed unconaliy.

Queson 4: Dierence beween Regression and Reesng?

- Regression Tesng: Regression esng is perormed o ensure ha new code changes have no aeced exisng
unconaliy. I involves reesng exisng es cases and running new ones.
- Reesng: Reesng ocuses on esng he specic deecs ha were ound and xed. I ensures ha he repored
issues are resolved and do no reoccur.

Queson 5: Dierence beween Funconal and Regression Tesng?

- Funconal Tesng: Funconal esng veries wheher he sofware's eaures and uncons work according o
specicaons. I is perormed o validae ha he sofware mees is unconal requiremens.
- Regression Tesng: Regression esng is aimed a checking wheher new code changes have inroduced new deecs
or caused exisng unconaliy o break.

Queson 6: Dierence beween Severiy and Prioriy?

- Severiy: Severiy indicaes he impac o a deec on he sysem's unconaliy. I caegorizes deecs based on how
severely hey aec he applicaon, e.g., "Crical," "Major," "Minor."
- Prioriy: Prioriy deermines he order in which deecs should be xed. I's based on business or projec needs and
may be caegorized as "High," "Medium," or "Low."

Queson 7: Dierence beween Tes Plan and Tes Sraegy?

- Tes Plan: A es plan is a deailed documen ha oulines how esng will be conduced or a specic projec. I
includes objecves, scope, schedules, and es cases.
- Tes Sraegy: A es sraegy is a higher-level documen ha denes he approach o esng across mulple projecs.
I ses guidelines or how esng should be done in an organizaon.

Queson 8: Dierence beween Boundary Value Analysis and Equivalence Paroning?

- Boundary Value Analysis: Boundary Value Analysis ocuses on esng he values a he boundaries o accepable inpu
ranges. I ess or issues ha ofen occur a he edges, such as minimum and maximum values.
- Equivalence Paroning: Equivalence Paroning divides he inpu domain ino groups or parons and ess a
represenave value rom each paron. I helps reduce he number o es cases while ensuring adequae coverage.

Creaed By Eng. Shady Ahmed +201023527158


Queson 9: Dierence beween Whie Box and Black Box Tesng?

- Whie Box Tesng: Whie box esng examines he inernal srucure and code o he sofware. Tesers need
knowledge o he sysem's archiecure and use his inormaon o design es cases.
- Black Box Tesng: Black box esng ocuses on he unconaliy o he sofware wihou knowledge o is inernal
code. Tesers validae he sofware based on is specicaons and behavior.

Queson 10: Handling Auomaon Tesng or 1000 Tes Cases

- For auomaon esng o 1000 es cases, i's crucial o priorize and selec es cases based on cricaliy and
coverage. I's also imporan o design modular and mainainable es scrips. You can use es auomaon
rameworks like TesNG or JUni and design mehods ha reurn mulple values using daa srucures like liss, maps,
or cusom objecs.

Queson 11: Bug Lie Cycle

- The bug lie cycle consiss o various saes like "New," "Assigned," "Open," "Fixed," "Veried," and "Closed." Each
sae represens he bug's saus and he acons aken by he developmen and esng eams. The bug progresses
hrough hese saes unl i's closed.

Queson 12: Bug Triage

- Bug riage is a process where a cross-unconal eam, including developers and esers, evaluaes newly repored
bugs.
- The eam priorizes and assigns he bugs based on heir severiy and impac on he projec. This process helps in
ecienly managing bug repors.

Queson 13: Wha is Exploraory Tesng?

- Exploraory esng is an approach where esers simulaneously design and execue es cases based on heir
inuion, experience, and domain knowledge.
- I's ofen unscriped and aims o nd deecs in an exploraory manner.

Queson 14: Wha is Ad-hoc Tesng?

- Ad-hoc esng is an inormal and unsrucured esng approach where esers explore he sofware wihou
predened es cases. Tesers randomly inerac wih he applicaon o nd deecs and issues.

Queson 15: Wha is Build Accepance Tesng?

- Build Accepance Tesng, also known as Smoke Tesng, is perormed on a new build or release o veriy ha he mos
crical unconalies work correcly. I ensures ha he build is sable enough or urher esng.

Creaed By Eng. Shady Ahmed +201023527158


Queson 16: Dierence beween Validaon and Vericaon?

- Validaon: Validaon checks wheher he sofware mees he user's requiremens and is  or is inended purpose.
I answers he queson, "Are we building he righ produc?"
- Vericaon: Vericaon ensures ha he sofware conorms o is specicaons and requiremens. I answers he
queson, "Are we building he produc righ?"

Queson 17: Explain Severiy and Prioriy, High Severiy wih Low Prioriy, Low Severiy and High Prioriy

- Severiy: Severiy indicaes he impac o a deec on he sysem. High severiy means he deec has a signican
impac.
- Prioriy: Prioriy deermines when a deec should be addressed. High prioriy means he deec should be xed
urgenly.
- High Severiy wih Low Prioriy: This means he deec has a signican impac on he sysem, bu i's no considered a
op prioriy or immediae xing.
- Low Severiy and High Prioriy: This means he deec has a low impac on he sysem bu needs o be addressed
urgenly.

Queson 18: Sequence o Execuon or Tes Cases wih Priories o -1, 0, 1, 2

- The sequence o execuon depends on he es execuon sraegy.


- Tes cases can be execued in any order, bu ypically hey are execued in ascending prioriy order: -1, 0, 1, and 2.

Queson 19: Explain Inner Join and Ouer Join in SQL

- Inner Join: An inner join in SQL reurns only he rows ha have maching values in boh ables being joined. I
excludes non-maching rows rom he resul se.
- Ouer Join: An ouer join reurns all rows rom one able and he maching rows rom he oher able. I includes non-
maching rows wih NULL values in columns rom he non-maching able.

Queson 20: Dierence beween DELETE, DROP & TRUNCATE in SQL

- DELETE: DELETE is used o remove specic rows rom a able based on a condion. I preserves he able srucure.
- DROP: DROP is used o delee an enre able or daabase, removing is srucure and daa.
- TRUNCATE: TRUNCATE is used o delee all rows rom a able, bu i mainains he able's srucure. I's aser han
DELETE bu canno be used wih condions.

Queson 21: Wha are Tes Design Techniques?

- Tes design echniques are mehods used o creae es cases and deermine he es daa.
- Common echniques include Equivalence Paroning, Boundary Value Analysis, Decision Table Tesng, Sae
Transion Tesng, and more.
- These echniques help ensure eecve es coverage.

Creaed By Eng. Shady Ahmed +201023527158


Queson 22: Wha is a Deerred Bug?

- A deerred bug is a bug ha is no xed immediaely bu is scheduled or a laer release or sprin.
- I's usually a low-prioriy issue ha doesn' impac he curren projec's goals.

Queson 23: How Do You Decide Wha Tess o Auomae?

- Tess are seleced or auomaon based on crieria like repeaabiliy, sabiliy, and he need or regression esng.
- High-prioriy, high-impac, and requenly execued ess are good candidaes or auomaon.

Queson 24: When Do You Decide o Sop he Tesng?

- Tesng is sopped when one or more exi crieria are me.


- These crieria may include reaching a specied es coverage, a predened number o deecs ound, adherence o
he schedule, and he achievemen o esng objecves.

Queson 25: How o Reduce Tes Execuon Time or a 1.5-Hour Tes Suie?

- To reduce es execuon me, consider parallel es execuon, selecve es suie execuon, opmizing es scrips,
and using ecien es rameworks.

Queson 26: Priorizing Tess wih -1, 0, 1, 2

- Tess are priorized in ascending order: -1, 0, 1, and 2.

Queson 27: Achievemens in Auomaon

- Achievemens in auomaon may include improving es coverage, reducing es execuon me, enhancing es daa
managemen, or successully implemenng es rameworks.

Queson 28: Dierence beween BDD and TDD

- BDD (Behavior-Driven Developmen): BDD is a sofware developmen mehodology ha ocuses on he behavior o
he applicaon rom he user's perspecve. I uses naural language descripons and scenarios o dene applicaon
behavior.
- TDD (Tes-Driven Developmen): TDD is a developmen process ha emphasizes wring ess beore wring code. I
helps ensure ha he code mees is requiremens and is esable.

Queson 29: Tes Plan and Seps o Creae One

- A es plan is a documen ha oulines how esng will be conduced.


- Seps o creae one include dening objecves, scope, es sraegy, es cases, schedules, resources, and deliverables.

Creaed By Eng. Shady Ahmed +201023527158


Queson 30: Inbound and Oubound or Tesng

- Inbound Tesng: Inbound esng reers o esng acvies conduced o validae daa or componens coming ino a
sysem. I ensures ha daa is acceped and processed correcly.
- Oubound Tesng: Oubound esng involves veriying daa or componens leaving a sysem. I ensures ha daa is
generaed or ransmied accuraely.

Queson 31: Smoke, Regression, and Saniy Tesng

- Smoke Tesng: Smoke esng veries ha he crical unconalies o he sofware are working afer a new build or
release. I's an inial check o ensure he sofware is sable enough or urher esng.
- Regression Tesng: Regression esng is perormed o ensure ha new code changes have no adversely aeced
exisng unconaliy. I includes reesng exisng es cases.
- Saniy Tesng: Saniy esng is a subse o regression esng ha ocuses on specic areas or eaures o ensure hey
sll work afer code changes. I checks i recen xes or changes have no broken relaed unconaliy.

Queson 32: Nex Seps I a Developer Rejecs an Open Deec

- I a developer rejecs an open deec, i ypically goes hrough he ollowing seps:
- The deec repor is reviewed by he developer and he eser.
- I i's deermined ha he deec is no valid or requires urher claricaon, i's marked as "Rejeced."
- I i's valid, he deec is assigned back o he developer or correcon.
- The developer xes he deec, and i goes hrough reesng.
- I he deec is reesed successully, i is marked as "Closed." I no, i goes hrough he bug lie cycle again.

Queson 33: Tes Merics

- Tes merics are measuremens and daa colleced during esng.


- They provide insighs ino he qualiy and progress o esng.
- Common es merics include deec densiy, es coverage, pass/ail raes, and es execuon me.

Queson 34: Priorizing Tess

- Tess are priorized based on acors like business requiremens, cricaliy, risk, dependencies, and cusomer needs.
- High-prioriy ess are execued rs, ollowed by medium and low-prioriy ess.

Queson 35: Auomaon Code Review/Walk Through

- Auomaon code review or walk-hrough is a process where auomaon scrips are reviewed by peers or expers o
ensure hey ollow coding sandards, are mainainable, and ree rom errors.
- I's done o improve scrip qualiy.

Creaed By Eng. Shady Ahmed +201023527158


Queson 36: Segregang Tess: Smoke, Saniy, Regression

To segregae ess ino Smoke, Saniy, and Regression suies:

- Smoke ess should be he mos crical and sable es cases, ensuring basic unconaliy.
- Saniy ess should cover core unconalies o veriy ha recen code changes haven' aeced hem.
- Regression ess should include a comprehensive se o es cases covering boh new and exisng unconaliy.

Queson 37: Execuon o Regression, Saniy, and Smoke Tess

The ming o execung hese ess can vary based on he projec's needs:

- Smoke ess are execued afer a new build or release o ensure basic unconaliy.
- Saniy ess are run o veriy specic changes or eaures, ypically in conjuncon wih new code.
- Regression ess are execued afer every code change o ensure ha exisng unconaliy is unaeced.

Queson 38: Wha Tess o Auomae?

- Tess o auomae are seleced based on crieria such as requency o execuon, repeaabiliy, cricaliy, and sabiliy.
- High-prioriy, high-impac, and requenly execued ess are suiable candidaes or auomaon.

Perormance Tesng

1. Wha is perormance esng?

Perormance esng is he process o esng a sysem or applicaon o measure is perormance

under a parcular workload.

2. Wha is he purpose o perormance esng?

The purpose o perormance esng is o ideny any bolenecks or perormance issues in he

sysem, so ha hey can be addressed beore he sysem goes live.

3. Wha are he ypes o perormance esng?

The ypes o perormance esng include load esng, sress esng, endurance esng, spike esng,

and scalabiliy esng.

Creaed By Eng. Shady Ahmed +201023527158


4. Wha is load esng?

Load esng is a ype o perormance esng ha measures he perormance o a sysem under a

specic load, such as he number o users or requess.

5. Wha is sress esng?

Sress esng is a ype o perormance esng ha measures he perormance o a sysem under

exreme condions, such as high rac or peak usage.

6. Wha is endurance esng?

Endurance esng is a ype o perormance esng ha measures he perormance o a sysem under

a susained workload, ypically over a long period o me.

7. Wha is spike esng?

Spike esng is a ype o perormance esng ha measures he perormance o a sysem when here

is a sudden and large increase in workload.

8. Wha is scalabiliy esng?

Scalabiliy esng is a ype o perormance esng ha measures how well a sysem can handle

increasing amouns o workload as he number o users or requess grows.

9. Wha is a perormance es plan?

A perormance es plan is a documen ha oulines he goals, scope, and approach o a

perormance esng projec.

10. Wha is a perormance es scrip?

A perormance es scrip is a program ha simulaes user behavior o es he perormance o a

sysem.

11. Wha is a virual user?

A virual user is a sofware program ha simulaes a user ineracng wih a sysem, and is used in

perormance esng o generae load on he sysem.

Creaed By Eng. Shady Ahmed +201023527158


12. Wha is a boleneck?

A boleneck is a poin in a sysem where he perormance is limied by a resource consrain, such as

CPU, memory, or nework bandwidh.

13. How do you ideny a boleneck?

You can ideny a boleneck by monioring he sysem during a perormance es and looking or

areas where he perormance is signicanly slower han expeced.

14. Wha is hroughpu?

Throughpu is he amoun o work ha a sysem can process in a given amoun o me, and is ofen

measured in ransacons per second (TPS).

15. Wha is response me?

Response me is he me i akes or a sysem o respond o a user reques, and is ofen measured

in milliseconds.

16. Wha is laency?

Laency is he delay beween when a user sends a reques and when hey receive a response, and is

ofen measured in milliseconds.

17. Wha is he dierence beween hroughpu and response me?

Throughpu measures he amoun o work a sysem can do, while response me measures how

quickly i can do ha work.

18. Wha is he goal o perormance esng?

The goal o perormance esng is o ensure ha a sysem can handle he expeced workload and

mee he perormance requiremens o he business.

19. Wha are some common perormance esng ools?

Some common perormance esng ools include JMeer, LoadRunner, Galing, and BlazeMeer.

Creaed By Eng. Shady Ahmed +201023527158


20. Wha is a perormance baseline?

A perormance baseline is a benchmark ha represens he expeced perormance o a sysem under

normal condions.

21. Wha is he purpose o a perormance baseline?

The purpose o a perormance baseline is o provide a reerence poin or uure perormance

esng, and o help ideny any changes in perormance over me.

22. Wha is a perormance boleneck?

A perormance boleneck is a poin in a sysem where he perormance is limied by a resource

consrain, such as CPU, memory, or nework bandwidh.

23. Wha is perormance uning?

Perormance uning is he process o opmizing a sysem or applicaon o improve is perormance.

24. Wha are some common perormance uning echniques?

Some common perormance uning echniques include opmizing code, improving daabase

queries, and opmizing server setngs.

25. Wha is a perormance issue?

A perormance issue is any problem ha impacs he perormance o a sysem, such as slow

response mes, high CPU usage, or nework bolenecks.

26. How do you diagnose a perormance issue?

To diagnose a perormance issue, you can use perormance monioring ools o ideny any

bolenecks or resource consrains in he sysem.

27. Wha is a perormance es repor?

A perormance es repor is a documen ha summarizes he resuls o a perormance esng

projec, including any issues ha were idened and recommendaons or improvemen.

Creaed By Eng. Shady Ahmed +201023527158


28. Wha is a perormance dashboard?

A perormance dashboard is a real-me display o key perormance merics or a sysem, such as

CPU usage, memory usage, and nework hroughpu.

29. Wha is a perormance hreshold?

A perormance hreshold is a predened limi or a perormance meric, such as response me or

hroughpu, ha indicaes when he sysem is perorming poorly.

30. Wha is a load balancer?

A load balancer is a device or sofware program ha disribues incoming nework rac across

mulple servers o opmize perormance and ensure high availabiliy

31. How does a load balancer work?

A load balancer works by disribung incoming nework rac across mulple servers based on

predened algorihms, such as round-robin or leas connecons.

32. Wha is a disribued sysem?

A disribued sysem is a nework o compuers ha work ogeher o provide a single sysem or

service.

33. Wha are some common challenges in perormance esng disribued sysems?

Some common challenges in perormance esng disribued sysems include nework laency, daa

consisency, and load balancing.

34. Wha is a perormance esng environmen?

A perormance esng environmen is a replica o a producon environmen ha is used or

perormance esng.

Creaed By Eng. Shady Ahmed +201023527158


35. Wha are some consideraons when setng up a perormance esng environmen?

Some consideraons when setng up a perormance esng environmen include ensuring ha he

environmen is represenave o he producon environmen, and ha i has enough resources o

suppor he expeced workload.

36. Wha is he dierence beween sress esng and load esng?

Sress esng measures he perormance o a sysem under exreme condions, while load esng

measures he perormance o a sysem under a specic load.

37. Wha is he dierence beween a load es and a soak es?

A load es measures he perormance o a sysem under a specic load, while a soak es measures

he perormance o a sysem over a prolonged period o me o ideny any issues wih long-erm

usage.

38. Wha is a warm-up period in perormance esng?

A warm-up period is a period o me a he beginning o a perormance es during which he

sysem is allowed o sabilize and reach a seady sae beore he acual es begins.

39. Wha is an SLA?

An SLA (Service Level Agreemen) is a conrac beween a service provider and a cusomer ha

denes he level o service ha will be provided.

40. Wha is an SLO?

An SLO (Service Level Objecve) is a measurable arge ha is se or a specic service level meric,

such as response me or upme.

41. Wha is an SLI?

An SLI (Service Level Indicaor) is a measurable meric ha is used o rack he perormance o a

sysem or service, such as response me or error rae.

Creaed By Eng. Shady Ahmed +201023527158


42. Wha is a perormance budge?

A perormance budge is a predened limi or perormance merics, such as response me or page

load me, ha are used o ensure ha a sysem mees he perormance requiremens o he

business.

43. Wha is perormance esng in Agile developmen?

Perormance esng in Agile developmen is he process o incorporang perormance esng ino

he Agile developmen liecycle o ensure ha perormance issues are idened early and can be

addressed quickly.

44. Wha are some common ools used in perormance esng?

Some common ools used in perormance esng include Apache JMeer, LoadRunner, Galing, and

Selenium.

45. Wha is he dierence beween a perormance es plan and a es sraegy?

A perormance es plan is a deailed documen ha oulines he specic ess ha will be

perormed, while a es sraegy is a higher-level documen ha oulines he overall approach o

esng, including perormance esng.

46. Wha are some common perormance esng merics?

Some common perormance esng merics include response me, hroughpu, error rae, and

concurrency.

47. Wha is a baseline in perormance esng?

A baseline in perormance esng is a se o perormance merics ha represen he normal

perormance o a sysem under a specic se o condions.

48. Wha is a spike es?

A spike es is a ype o perormance es ha measures he abiliy o a sysem o handle sudden

spikes in rac or workload.

Creaed By Eng. Shady Ahmed +201023527158


49. Wha is a ramp-up period in perormance esng?

A ramp-up period is a period o me during a perormance es during which he workload is

gradually increased o reach he desired level.

50. Wha are some bes pracces or perormance esng?

Some bes pracces or perormance esng include sarng wih a clear undersanding o he

business requiremens, using realisc daa and scenarios, and involving sakeholders hroughou he

process o ensure ha he resuls are relevan and aconable.

51. Wha is a perormance es plan?

A perormance es plan is a documen ha oulines he approach, objecves, scope, resources, and

melines or a perormance esng projec.

52. Wha is scalabiliy esng?

Scalabiliy esng is a ype o perormance esng ha measures he abiliy o a sysem o handle

increasing workloads by adding more resources or nodes.

53. Wha is a load es scenario?

A load es scenario is a combinaon o user behavior, es daa, and workload parameers ha are

used o simulae realisc usage o he sysem under es.

54. Wha is a es bed?

A es bed is he hardware, sofware, and nework inrasrucure ha is used o run perormance

ess.

55. Wha is a perormance boleneck?

A perormance boleneck is a componen in he sysem ha limis is abiliy o handle a specic

workload or user load.

Creaed By Eng. Shady Ahmed +201023527158


56. Wha is a perormance esng ramework?

A perormance esng ramework is a se o ools, mehodologies, and bes pracces ha are used

o creae and execue perormance ess.

57. Wha is a soak es?

A soak es is a ype o perormance es ha measures he perormance o a sysem over a

prolonged period o me o ideny any issues wih long-erm usage.

58. Wha is a sress es?

A sress es is a ype o perormance es ha measures he perormance o a sysem under exreme

condions, such as high user loads or peak rac.

59. Wha is a virual user?

A virual user is a simulaed user ha is used in perormance esng o simulae realisc user

behavior and workload.

60. Wha is a hroughpu?

Throughpu is he number o requess or ransacons ha a sysem can handle per uni o me,

usually measured in ransacons per second (TPS).

61. Wha is a ransacon?

A ransacon is a sequence o acons or operaons ha represens a complee uni o work, such as

adding an iem o a shopping car and checking ou.

62. Wha is a user load?

User load is he number o simulaneous users or virual users ha are accessing he sysem during a

perormance es.

63. Wha is daabase perormance uning?

Daabase perormance uning is he process o opmizing daabase queries, indexes, and setngs o

improve he perormance o a sysem.

Creaed By Eng. Shady Ahmed +201023527158


64. Wha is nework laency?

Nework laency is he delay beween when a reques is sen rom a clien o a server and when he

response is received, caused by he me i akes or daa o ravel across he nework.

65. Wha is page load me?

Page load me is he me i akes or a web page o ully load in a user's browser, including all

images, scrips, and oher resources.

66. Wha is he dierence beween a perormance es and a load es?

A perormance es measures he perormance o a sysem under a specic se o condions, while a

load es measures he perormance o a sysem under varying user loads.

67. Wha is a ramp-down period?

A ramp-down period is a period o me a he end o a perormance es during which he workload

is gradually decreased o reurn he sysem o a sable sae.

68. Wha is a warm-up period?

A warm-up period is a period o me a he beginning o a perormance es during which he

sysem is allowed o sabilize and reach a seady sae beore he acual es begins.

69. Wha is he dierence beween sress esng and spike esng?

Sress esng measures he perormance o a sysem under exreme condions, while spike esng

measures he abiliy o a sysem o handle sudden spikes in rac or workload.

70. Wha is a disribued load es?

A disribued load es is a ype o perormance es ha simulaes user rac rom mulple locaons

and devices o measure he perormance o a sysem under realisc usage scenarios.

Creaed By Eng. Shady Ahmed +201023527158

You might also like