SQL ProblemSolving SystemDesign Questions
SQL ProblemSolving SystemDesign Questions
SQL Questions
```sql
FROM employees
```
```sql
FROM employees
GROUP BY department_id;
```
Problem-Solving Questions
```python
def is_palindrome(s):
return s == s[::-1]
# Example
SQL, Problem Solving, and System Design Questions
```
2. Write a Python program to find the longest common prefix among a list of strings.
```python
def longest_common_prefix(strings):
if not strings:
return ""
prefix = strings[0]
prefix = prefix[:-1]
if not prefix:
return ""
return prefix
# Example
```
**Database Schema:**
```sql
);
```
**Python Implementation:**
```python
class URLShortener:
def __init__(self):
self.url_map = {}
self.counter = 1
self.base_url = "http://short.ly/"
self.url_map[short_url] = long_url
self.counter += 1
SQL, Problem Solving, and System Design Questions
return short_url
```