Solve common string and subarray problems
Company: LinkedIn
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
You are given three coding tasks:
1) **Reverse a string**
- Input: a string `s`.
- Output: the string with characters in reverse order.
2) **Maximum sum of a contiguous subarray**
- Input: an integer array `nums` (may contain negative numbers).
- Output: the maximum possible sum of any **non-empty contiguous** subarray.
- Example: `[-2,1,-3,4,-1,2,1,-5,4]` → `6` (subarray `[4,-1,2,1]`).
3) **Maximum product of a contiguous subarray**
- Input: an integer array `nums` (may contain negative numbers and zeros).
- Output: the maximum possible product of any **non-empty contiguous** subarray.
- Example: `[2,3,-2,4]` → `6` (subarray `[2,3]`).
Quick Answer: Assesses core string and array manipulation skills by requiring string reversal and contiguous-subarray computations for maximum sum and maximum product, identified under the Coding & Algorithms category.