You have got 1 million parking slots. At a time a parking slot can be free or not. To get next slot easily which data structure to implement?



You have got 1 million parking slots. At a time a parking slot can be free or not. To get next slot ..

Answer / Mayank Yadav

In C#, for efficiently managing the status of 1 million parking slots (free or occupied), you can implement a BitArray since it allows storing boolean values in contiguous memory and provides fast access to individual bits. However, if you need to perform more complex operations like finding the next free slot, you might want to consider using other data structures such as linked lists or hash tables.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Why we use get and set method in c#?

1 Answers  


How do we achieve encapsulation in c#?

1 Answers  


What is the use of tuple in c#?

1 Answers  


1)what is difference between char and varchar in sql server 2005 2) what is composite key and candidate key 3) what is temporary table and derived table 4) how to calculate difference between two dates

1 Answers   Wipro,


What is the difference between a function and a method?

1 Answers  


What?s class SortedList underneath?

2 Answers  


If I return out of a try/finally in c#, does the code in the finally-clause run?

1 Answers  


Can constructor be private c#?

1 Answers  


What is public or shared assemblies ?

1 Answers  


What is the difference between array and list in c#?

1 Answers  


why C++ Partial Object Oriented Programming Language and C# and Java Fully Object Oriented Language

11 Answers   3i Infotech, Alexa, Assyst, Naresh i Technologies, TCS,


What is a service layer c#?

1 Answers  


Categories