Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7049893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:04:36+00:00 2026-05-28T03:04:36+00:00

I came across a interview question which i did not know the answer (

  • 0

I came across a interview question which i did not know the answer ( little help 🙂 )
well it stated something of the sort :

Class SomeClass : IDisposable 
{
    public void Dispose()
    {
        while(true)
        {
        }
    } 

    ~SomeClass()
    {
        Dispose();
    }
}  

1) Does the object get finalized when no longer referenced after the next GC? My answer was NO, because the finalization thread will be stuck on the infinite loop.

2) What could be done in the Dispose to end the finalization and how many times will the loop continue before the object is Disposed ( with out taking in to account the time it will spend in the next Gen )

I am not particularly clear of the exact question (2) .I kinda ran out of time …

Not knowing the answer I put a static counter that gets to 3 and calls break and stated 3
which technically would work :), but that’s not the answer

I’m guessing it as something to do with GC.SupressFinalize() ?
maybe calling GC.SupressFinalize() before entering the loop ?

any ideas if not on the answer to the unclear question , more as to what they might of been aiming for ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:04:37+00:00Added an answer on May 28, 2026 at 3:04 am

    It’s rather immaterial what happens. The CLR will terminate the program, there is a 2 second timeout on a finalizer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across an interesting algorithm question in an interview. I gave my answer
I came across this post , which reports the following interview question: Given two
i came across an interview question which required me to simulate a car race
i came across an interview question which asks while searching a value in an
I came across this question in one Interview. Please help me in getting the
Came across a problem which google searches could not help me with. I have
Possible Duplicate: Help with algorithm problem from SPOJ Came across this interview question. Given
I came across this question on an interview questions thread. Here is the question:
I am preparing for my interview and came across this question: Consider that i
I came across this problem while preparing for an interview and curious to know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.