Number 1 Interview Question

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 6460 Views - Last Post: 10 March 2011 - 02:11 PM

#16 Tethik  Icon User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 61
  • Joined: 14-March 10

Re: Number 1 Interview Question

Posted 10 March 2011 - 01:06 PM

#!/usr/bin/env ruby

if(ARGV.length < 1)
	puts "Usage: reverseString <string>"
	puts "Returns the given string in reversed order"
	exit
end

puts ARGV[0].reverse


Heh, ruby :)

Edit:
Otherwise I'd likely go for something like:
//pseudocode
for i from 0 to string.length / 2
{
 swap(string[i], string[string.length - i])
}


This post has been edited by Tethik: 10 March 2011 - 01:13 PM

Was This Post Helpful? 0
  • +
  • -

#17 thursdayniac  Icon User is offline

  • D.I.C Regular

Reputation: 6
  • View blog
  • Posts: 255
  • Joined: 26-April 09

Re: Number 1 Interview Question

Posted 10 March 2011 - 02:11 PM

The one question I have been asked at every single interview(as a entry level .NET dev) is this: can you explain the difference between an interface and an abstract class.

This post has been edited by thursdayniac: 10 March 2011 - 02:11 PM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2