String Reversal
Which of the following methods is most efficient for reversing a string in most programming languages?
- Using a loop to iterate backwards and construct a new string.
- Using the `reverse()` method directly on the string object.
- Converting the string to an array, using the array's `reverse()` method, and then joining back into a string.
- Using recursion to swap characters from the beginning and end.
- Converting the string to an array, using the arrays `revers()` method, and then joning back into a string.
Array Searching
Which search algorithm is most suitable for finding an element in a sorted array?
- Linear Search
- Bubble Sort
- Binary Search
- Sequential search
- Insertion Sort
String Pattern Matching
Which string method is commonly used for finding the index of the first occurrence of a substring within a larger string?
- search()
- substring()
- indexOf()
- findIndex()
- indexOff()
Array Sorting
Which sorting algorithm generally has the best average-case time complexity?
- Bubble Sort
- Insertion Sort
- Quick Sort
- Selection Sort
- Merge Sort
String Manipulation - Case Sensitivity
What is the purpose of converting both strings to lowercase before comparing them?
- To reduce memory usage.
- To handle case-insensitive comparisons.
- To speed up the comparison process.
- To prevent errors during comparison.
- To handle case-sensitve comparison.
Array Deduplication
Which data structure is most efficient for removing duplicate elements from an array?
- Stack
- Queue
- Set
- Linked List
- Tree
String Splitting
Which string method is commonly used for breaking a string into an array of substrings based on a delimiter?
- join()
- concat()
- split()
- slice()
- Spilt()
Array Rotation
What is array rotation?
- Shifting elements in the array by a certain number of positions.
- Sorting the elements in ascending order.
- Reversing the elements in the array.
- Removing duplicate elements from the array.
- Adding new element to the array.
String Concatenation
Which operator or method is typically used to combine two or more strings into a single string?
- subtract()
- add()
- concat()
- divide()
- conkat()
Array Mapping
What is the purpose of the `map()` function when applied to an array?
- To filter elements based on a condition.
- To reduce the array to a single value.
- To transform each element of the array using a provided function.
- To sort the array.
- To transform each elemant of the array using a provided function.