SlideShare uma empresa Scribd logo
1 de 2
.Net Interview Questions on Garbage
Collection
Garbage Collection in .Net
.Net Framework's -Memory Management Garbage Collector which manages allocation and release of memory
from application.Now developers no need to worry about memory allocated for each object which is created
on application . garbage collector automatically manages memory on application
Garbage Collection Interview Questions
I would like share this horrible experience which I faced in one of the big IT multinational company. Even though I
have 8 years of experience, I flunked very badly and I flunked due to 1 topic "Garbage collector". I hope the below
discussion will help some one down the line when facing c sharp and dot net interviews.I justhope dot net interviews
get more matured down the line and ask practical questions rather than asking questions which we do notuse on day
to day to basis.
The interviewer started with a basic question which I knew pretty well
.NET Interview Questions and answers on Garbage Collector
What is a garbage collector?
Garbage collector is a background process which checks for unused objects in the application and cleans them up.
After that answer my guess was the interviewer will not probe more....but fate turned me down ,
came the bouncer.
What are generations in garbage collector?
Generation define the age of the object.
Well i did not answer the question , i have just written down by searching in google....
How many types of Generations are there in GC garbage collector?
There are 3 generations gen 0 , gen 1 and gen 2.
Then came a solid tweak questions which i just slipped by saying Yes...
Does garbage collector clean unmanaged objects ?
No.
Then came the terror question...which i never knew...
When we define clean up destructor , how does it affect garbage collector?
If you define clean up in destructor garbage collector will take more time to clean up the objects and more and more
objects are created in Gen 2..
How can we overcome the destructor problem ?
By implementing "Idisposable" interface.
The above question was tricky , you can search in google for finalize and dispose patterns.
Where do we normally put unmanaged code clean up?.
In finalize a.k.a destructor.
One thing i learnt from this interview experience is one thing but we also should know core
concepts in detail to crack Dot net interviews .
By ShivPrasad Koirala
For more Queries please visit : http://www.questpond.com

Mais conteúdo relacionado

Destaque

Dot net interview questions
Dot net interview questionsDot net interview questions
Dot net interview questions
Netra Wable
 
Dot Net Accenture
Dot Net AccentureDot Net Accenture
Dot Net Accenture
Sri K
 

Destaque (12)

Types of instrument
Types of instrumentTypes of instrument
Types of instrument
 
Functional Dependency Injection in C#
Functional Dependency Injection in C#Functional Dependency Injection in C#
Functional Dependency Injection in C#
 
Interview questions on asp
Interview questions on aspInterview questions on asp
Interview questions on asp
 
Dot net interview questions
Dot net interview questionsDot net interview questions
Dot net interview questions
 
Top 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answersTop 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answers
 
Dot Net Accenture
Dot Net AccentureDot Net Accenture
Dot Net Accenture
 
Railway reservation system
Railway reservation systemRailway reservation system
Railway reservation system
 
PAPER PRESENTATION
PAPER PRESENTATIONPAPER PRESENTATION
PAPER PRESENTATION
 
HTML & XHTML Basics
HTML & XHTML BasicsHTML & XHTML Basics
HTML & XHTML Basics
 
Online railway reservation system
Online railway reservation systemOnline railway reservation system
Online railway reservation system
 
ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
ASP.NET MVC Interview Questions and Answers by Shailendra ChauhanASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
 
E-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONE-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATION
 

Último

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Último (20)

Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Net interview questions on garbage collection

  • 1. .Net Interview Questions on Garbage Collection Garbage Collection in .Net .Net Framework's -Memory Management Garbage Collector which manages allocation and release of memory from application.Now developers no need to worry about memory allocated for each object which is created on application . garbage collector automatically manages memory on application Garbage Collection Interview Questions I would like share this horrible experience which I faced in one of the big IT multinational company. Even though I have 8 years of experience, I flunked very badly and I flunked due to 1 topic "Garbage collector". I hope the below discussion will help some one down the line when facing c sharp and dot net interviews.I justhope dot net interviews get more matured down the line and ask practical questions rather than asking questions which we do notuse on day to day to basis. The interviewer started with a basic question which I knew pretty well .NET Interview Questions and answers on Garbage Collector What is a garbage collector? Garbage collector is a background process which checks for unused objects in the application and cleans them up. After that answer my guess was the interviewer will not probe more....but fate turned me down , came the bouncer. What are generations in garbage collector? Generation define the age of the object. Well i did not answer the question , i have just written down by searching in google.... How many types of Generations are there in GC garbage collector? There are 3 generations gen 0 , gen 1 and gen 2. Then came a solid tweak questions which i just slipped by saying Yes... Does garbage collector clean unmanaged objects ? No. Then came the terror question...which i never knew...
  • 2. When we define clean up destructor , how does it affect garbage collector? If you define clean up in destructor garbage collector will take more time to clean up the objects and more and more objects are created in Gen 2.. How can we overcome the destructor problem ? By implementing "Idisposable" interface. The above question was tricky , you can search in google for finalize and dispose patterns. Where do we normally put unmanaged code clean up?. In finalize a.k.a destructor. One thing i learnt from this interview experience is one thing but we also should know core concepts in detail to crack Dot net interviews . By ShivPrasad Koirala For more Queries please visit : http://www.questpond.com