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

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
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
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
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Último (20)

Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
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.
 
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
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
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
 
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
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
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
 
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
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
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
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
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
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 

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