True or False: A string is the same thing as an array.
I had an interview the other day and the above question was asked. I said false, but the interviewer said it was actually true. I explained to her that a string is a data type and an array is an object that holds multiple instances of a variable, and that they aren't even similar concepts. But, she was an HR person who was just reading tech questions that were handed to her, so she couldn't elaborate or relate to my point.
A coworker later explained the True answer by stating that a string is actually a character array... thus, a string is an array. Now, if a string is a character array, that doesn't mean that document arrays or integer arrays qualify as strings. Thus, a string is not the same thing as an array.
But even so, (considering C#) a string isn't even a character array. In order to do character manipulation on a string (without using concatenation methods), you have to convert the string to a character array. Now, if a string was synonymous with a character array, why would you need to convert it? Wouldn't you just be able to call each character in the string implicitly as you would a character array? No! Why? Because a string is not a character array!
I liken it to asking, "Is a primary key the same as a unique identifier?" The answer is false. Reason being: A primary key is a unique identifier, but you can have unique identifiers in a table without setting them as keys. What do you all think? Is a string (data type) the same thing as an array (object type)? If so, why?