Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What is garbage collection in JavaScript?

View

Which algorithm is commonly used for garbage collection in JavaScript?

View

When does the garbage collector run in JavaScript?

View

What does "marking" refer to in the mark-and-sweep algorithm?

View

Which of the following is a common trigger for garbage collection?

View

How does JavaScript determine that an object is no longer needed?

View

Which statement is true about the garbage collector?

View

What type of reference keeps an object from being garbage collected?

View

What can lead to a memory leak in JavaScript?

View

Which of the following methods can help manage memory leaks?

View

What is garbage collection in JavaScript?

A process to clean the code
Automatic memory management
A way to speed up execution
A debugging tool

Which algorithm is commonly used for garbage collection in JavaScript?

Mark-and-sweep
Quick sort
Merge sort
Depth-first search

When does the garbage collector run in JavaScript?

Only when the program starts
At regular intervals
When memory is low
When there are memory leaks

What does "marking" refer to in the mark-and-sweep algorithm?

Marking variables as global
Identifying reachable objects
Adding comments to the code
Highlighting syntax errors

Which of the following is a common trigger for garbage collection?

A function call
Creating an object
Allocating memory
All of the above

How does JavaScript determine that an object is no longer needed?

When the variable is out of scope
When the object is deleted
When the object is marked
When the object is not referenced anymore

Which statement is true about the garbage collector?

It can free up memory instantly.
It has no impact on performance.
It can create memory leaks.
It runs in a separate thread.

What type of reference keeps an object from being garbage collected?

Weak reference
Strong reference
Soft reference
Temporary reference

What can lead to a memory leak in JavaScript?

Unused variables
Circular references
Global variables
All of the above

Which of the following methods can help manage memory leaks?

Avoiding global variables
Using let/const instead of var
Removing event listeners
All of the above