Reverse an array without using Array.Reverse()

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 728 Views - Last Post: 22 October 2017 - 10:28 AM Rate Topic: -----

#16 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5895
  • View blog
  • Posts: 20,126
  • Joined: 05-May 12

Re: Reverse an array without using Array.Reverse()

Posted 18 October 2017 - 03:23 PM

C# 5.0 spec is what I quoted above. I think that is VS2013 that has C# 5.0.
Was This Post Helpful? 0
  • +
  • -

#17 JapanDave  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 366
  • Joined: 01-February 16

Re: Reverse an array without using Array.Reverse()

Posted 21 October 2017 - 02:08 AM

I have been reading this thread with interest, but I am at a loss as to why someone would ask you to do something like this? Its like re-inventing the wheel, what is the point? Why I say this is b/c I am still at the very beginning of learning C# and I could write a function that would reverse an array before I even knew about the method Array.Reverse() . I hardly think that this would show that you are qualified to program?
Was This Post Helpful? 0
  • +
  • -

#18 andrewsw  Icon User is online

  • the case is sol-ved
  • member icon

Reputation: 6379
  • View blog
  • Posts: 25,770
  • Joined: 12-December 12

Re: Reverse an array without using Array.Reverse()

Posted 21 October 2017 - 03:19 AM

Maybe you're a genius, or your memory is faulty ;).

It is a nice small challenge, particularly to complete without a second array.

(If you've been reading the thread with interest then its purpose is served.)
Was This Post Helpful? 0
  • +
  • -

#19 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5895
  • View blog
  • Posts: 20,126
  • Joined: 05-May 12

Re: Reverse an array without using Array.Reverse()

Posted 21 October 2017 - 05:10 AM

What is the point of implementing a linked list, or walking a binary tree... two of the other common interview questions?

Personally, I use them as ice breaker questions to get the candidate used to writing on the whiteboard while explaining what they are thinking and why they are making particular choices. It also makes a move of their familiarity with a particular language.

Once done with the ice breaker, I move on to a more complicated question.
Was This Post Helpful? 0
  • +
  • -

#20 soldi3r  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 27-September 17

Re: Reverse an array without using Array.Reverse()

Posted 22 October 2017 - 10:28 AM

View PostJapanDave, on 21 October 2017 - 02:08 AM, said:

I have been reading this thread with interest, but I am at a loss as to why someone would ask you to do something like this? Its like re-inventing the wheel, what is the point? Why I say this is b/c I am still at the very beginning of learning C# and I could write a function that would reverse an array before I even knew about the method Array.Reverse() . I hardly think that this would show that you are qualified to program?

It's not important they would ask so complex things. They just tried to explore my concept. And yes it's obvious that without using Array.Reverse() it'll confuse most of the people.

View PostSkydiver, on 21 October 2017 - 05:10 AM, said:

What is the point of implementing a linked list, or walking a binary tree... two of the other common interview questions?

Personally, I use them as ice breaker questions to get the candidate used to writing on the whiteboard while explaining what they are thinking and why they are making particular choices. It also makes a move of their familiarity with a particular language.

Once done with the ice breaker, I move on to a more complicated question.

Yes absolutely, there would be much more like these.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2