e-learning question

T

Tony Johansson

Hi!

If you have these two question that says the following.
1. Uses more memory when working with file system.
2. Provides better performance over FileStream

and each of these question should be connected to one of these
FileStream, MemoryStream or BufferedStream.

The first question . "Uses more memory when working with file system" should
be connected to the FileStream.
Can somebody explain why FileStream is considered as the right answer to
that question

The second question. "Provides better performance over FileStream" should be
connected to MemoryStream."
I find that the BufferedStream is just as good answer as the MemoryStream.
So again can somebody explain why MemoryStream is considered as the right
answer to that question

//Tony
 
W

Willem van Rumpt

Tony said:
Hi!

If you have these two question that says the following.
1. Uses more memory when working with file system.
2. Provides better performance over FileStream

and each of these question should be connected to one of these
FileStream, MemoryStream or BufferedStream.

The first question . "Uses more memory when working with file system" should
be connected to the FileStream.
Can somebody explain why FileStream is considered as the right answer to
that question

The only reason I can think of is that the only stream explicitly
involved with the file system, is the FileStream. The others don't have
any connection to the file system.
The second question. "Provides better performance over FileStream" should be
connected to MemoryStream."
I find that the BufferedStream is just as good answer as the MemoryStream.
So again can somebody explain why MemoryStream is considered as the right
answer to that question

I agree.
If the question you quoted are exactly as they appear, without any
contextual information, either answer would do in my opinion.
 
A

Arne Vajhøj

If you have these two question that says the following.
1. Uses more memory when working with file system.
2. Provides better performance over FileStream

and each of these question should be connected to one of these
FileStream, MemoryStream or BufferedStream.

The first question . "Uses more memory when working with file system" should
be connected to the FileStream.
Can somebody explain why FileStream is considered as the right answer to
that question

The second question. "Provides better performance over FileStream" should be
connected to MemoryStream."
I find that the BufferedStream is just as good answer as the MemoryStream.
So again can somebody explain why MemoryStream is considered as the right
answer to that question

Completely bullshit questions.

Memorize whatever the material taught you, answer the questions
in the test as they want to hear them. And then forget everything
about it.

Arne
 
T

Tony Johansson

Willem van Rumpt said:
The only reason I can think of is that the only stream explicitly involved
with the file system, is the FileStream. The others don't have any
connection to the file system.


I agree.
If the question you quoted are exactly as they appear, without any
contextual information, either answer would do in my opinion.

Was it questions like these when you did the exam ?
I mean a question according to us have two answers being the right but only
one is the correct choice.

//Tony
 
W

Willem van Rumpt

Tony said:
Was it questions like these when you did the exam ?
I mean a question according to us have two answers being the right but only
one is the correct choice.

//Tony

I can understand why they they picked the answers as correct, but I
consider the *questions* to be very dubious to begin with.

If I have to choose the fastest stream from those three, then yes,
MemoryStream is the one to go for from the list. But I can only see a
reason for such a question, if the intent is to teach what the
difference is between a File(Stream) and (a) Memory(Stream).

I did one exam, but that was back in 2004 or 2005. IIRC, the actual
questions on the exam were for the most part formulated in a precise,
and unambiguous manner. The questions needed to be read thoroughly, but
if you /did/, there would be a logical and clear answer to the question
(which would also be present as one of the options ;) ).
 
K

Konrad Neitzel

Hi Tony!

Was it questions like these when you did the exam ?
I mean a question according to us have two answers being the right but
only one is the correct choice.

I did the 070-536 in February and at least I got no question where it was
that unclear what the right answer could be.

Of course, the questions do not give a big context but normaly you get
exactly the information that is required. So when you read the question
carefully, then you can think about the differences and answer the right
answer.

Of ocurse: I did the exam only once so maybe there are some questions like
the question you gave and I was simply lucky to not get such a question in
my exam :)

With kind regards,

Konrad
 
P

Patrice

The first question . "Uses more memory when working with file system"
should be connected to the FileStream.
Can somebody explain why FileStream is considered as the right answer to
that question

Someone else answered.
The second question. "Provides better performance over FileStream" should
be connected to MemoryStream."
I find that the BufferedStream is just as good answer as the MemoryStream.

A possible explanation is that a buffered stream assumes that you are
reading precisely from something that needs buffering (ie. data needs to be
transfered). With a memory stream you are pretty sure that the data is
readily available from memory so you always read from memory. So it provides
a better performance.
 
G

Göran Andersson

Tony said:
Hi!

If you have these two question that says the following.
1. Uses more memory when working with file system.
2. Provides better performance over FileStream

and each of these question should be connected to one of these
FileStream, MemoryStream or BufferedStream.

The first question . "Uses more memory when working with file system" should
be connected to the FileStream.
Can somebody explain why FileStream is considered as the right answer to
that question

The question is a bit unclear, it's not certain if it refers to one
class that has different characteristics depending on whether it's used
against the file system, or if it refers to different classes that can
be used against the file system.

If it is the first, then it's only the BufferedStream that has the
option to be used with both the file system and something else.

If it's the second, then it would also be the BufferedStream, as that
would wrap a FileStream and also allocate buffers in memory.

The FileStream is the one class that uses the least memory of the
options, so I can't see how that would be the correct answer in any case.
The second question. "Provides better performance over FileStream" should be
connected to MemoryStream."
I find that the BufferedStream is just as good answer as the MemoryStream.
So again can somebody explain why MemoryStream is considered as the right
answer to that question

File I/O is already buffered (as you can't access anything smaller than
a cluster in the end), so wrapping a FileStream in a BufferedStream
doesn't guarantee any real improvement. A MemoryStream on the other hand
is significantly faster than using a FileStream.

However, this question is also a bit unclear. It could also be read as
identifying the class that could possibly improve the performance of a
FileStream, and then the BufferedStream would be the only option.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top