<reasoning_content>
*   Class: `JobQueue`
    *   New Method: `process_job(job_id: str, Processor: Callable) -> bool`
    *   Behavior:
        1.  Identify `data` from `add_job(job_id, data)`.
        2.   Call `processor(data)`.
        3.   Retry on exception. Max 4 attempts (1 initial + 3 retries).
        4.  Track retry count.
        5.  Exponential backoff: 1s, 2s, 4s.
        6.  **CRITICAL**: Do *not* sleep. Record delays as data.
        7.  Return `True` if successful, `False` if all 4 fail.
    *   Constraints: Standard library only. No explanations.

    ```python
    from typing import Dict, Callable, Any

    class JobQueue:
        def __init__(self):
            self.jobs: Dict[str, Dict[str, Any]] = {}
            self.retry_counts: Dict[str, int] = {}

        def add_job(self, job_id: str, data: Dict[str, Any]):
            self.jobs[job_id] = data
            self.retry_counts[job_id] = 0

        def process_job(self, job_id: str, processor: Callable[[Dict[str, Any]], Any]) -> bool:
            if job_id not in self.jobs:
                return False

            data = self.jobs[job_id]
            max_attempts = 4

            for attempt in range(max_attempts):
                try:
                    processor(data)
                    return True
                except Exception:
                    if attempt < max_attempts - 1:
                        self.retry_counts[job_id] += 1
                        # Exponential backoff: 1s, 2s, 4s
                        # Calculation: 2 ** retry_count
                        delay = 2 ** self.retry_counts[job_id]
                        # Record delay as data (e.g., append to a list in data)
                        if "delays" not in data:
                            data["delays"] = []
                        data["delays"].append(delay)
                    else:
                        # Last attempt failed
                        return False
            return False
    ```

    *   `retry_counts` maps `job_id` to the count of *failed* attempts.
    *   Attempt 0: Fails -> count becomes 1 -> delay 2^1 = 2? No, prompt says delays 1, 2, 4.
    *   Actually, prompt says: "delays of 1s, 2s, 4s".
    *   Attempt 1 (initial): fails. Attempt 2 (retry 1): delay 1s. Attempt 3 (retry 2): delay 2s. Attempt 4 (retry 3): delay 4s.
    *   Wait, if I have 4 attempts total:
        *   Attempt 1 (Index 0): Fails. Need 3 retries.
        *   Retry 1 (Index 1): Delay 1.
        *   Retry 2 (Index 2): Delay 2.
        *   Retry 3 (Index 3): Delay 4.
    *   So, if attempt `i` fails (where `i` is 0, 1, 2, 3):
        *   If `i == 0`, record delay 1 for the next try.
        *   If `i == 1`, record delay 2 for the next try.
        *   If `i == 2`, record delay 4 for the next try.
        *   If `i == 3`, no more retries allowed.

    *Refined Logic:*
    ```python
    for attempt in range(4):
        try:
            processor(data)
            return True
        except Exception:
            if attempt < 3: # We have retries left
                # retry_counts[job_id] is incremented per retry
                self.retry_counts[job_id] += 1
                delay = 2 ** (self.retry_counts[job_id] - 1)
                if "delays" not in data:
                    data["delays"] = []
                data["delays"].append(delay)
            else:
                return False
    ```
    Wait, if `retry_counts` starts at 0:
    - Attempt 0 fails: `retry_counts` becomes 1. `delay = 2 ** 0 = 1`. Correct.
    - Attempt 1 fails: `retry_counts` becomes 2. `delay = 2 ** 1 = 2`. Correct.
    - Attempt 2 fails: `retry_counts` becomes 3. `delay = 2 ** 2 = 4`. Correct.
    - Attempt 3 fails: Loop ends, returns False.

    ```python
    from typing import Dict, Callable, Any

    class JobQueue:
        def __init__(self):
            self.jobs: Dict[str, Dict[str, Any]] = {}
            self.retry_counts: Dict[str, int] = {}

        def add_job(self, job_id: str, data: Dict[str, Any]):
            self.jobs[job_id] = data
            self.retry_counts[job_id] = 0

        def process_job(self, job_id: str, processor: Callable[[Dict[str, Any]], Any]) -> bool:
            if job_id not in self.jobs:
                return False
            
            data = self.jobs[job_id]
            for attempt in range(4):
                try:
                    processor(data)
                    return True
                except Exception:
                    if attempt < 3:
                        self.retry_counts[job_id] += 1
                        delay = 2 ** (self.retry_counts[job_id] - 1)
                        if "delays" not in data:
                            data["delays"] = []
                        data["delays"]append(delay)
                    else:
                        return False
            return False
    ```

    Wait, prompt says: "Track the retry count per job. Use exponential backoff (delays of 1s, 2s, 4s)."
    Is it "Delay *before* retrying"?
    - Attempt 1 fails. Delay 1s. Then Attempt 2.
    - Attempt 2 fails. Delay 2s. Then Attempt 3.
    - Attempt 3 fails. Delay 4s. Then Attempt 4.
    - Attempt 4 fails. Done.

    Implementation looks correct.

    - Standard library only? Yes (typing).
    - Record delays as data? Yes.
    - Do not sleep? Yes.
    - Max 4 attempts? Yes.
    - Return bool? Yes.

    One detail: `self.retry_counts` tracks the retry count.
    Initial call is attempt 0.
    Failure 0 -> Retry 1 starts.
    Failure 1 -> Retry 2 starts.
    Failure 2 -> Retry 3 starts.
    Failure 3 -> No more retries.

    Let's ensure `retry_counts` incrementing logic is clean.

    ```python
    for i in range(4):
        try:
            processor(data)
            return True
        except Exception:
            if i < 3:
                self.retry_counts[job_id] += 1
                # retry_counts goes 1, 2, 3
                delay = 2 ** (self.retry_counts[job_id] - 1)
                if "delays" not in data:
                    data["delays"] = []
                data["delays"]append(delay)
            else:
                return False
    ```
    If I call `process_job` twice for the same `job_id`, the `retry_counts` won't reset unless `add_job` is called again. The prompt implies `add_job` is where data is stored. `retry_counts` should probably be reset or initialized within `add_job`.

    One more check: `data["delays"].append(delay)`. The prompt says "record the delays as data". This fits.

    Python Code only. No explanations.
</reasoning_content>

<content>
```python
from typing import Dict, Callable, Any

class JobQueue:
    def __init__(self):
        self.jobs: Dict[str, Dict[str, Any]] = {}
        self.retry_counts: Dict[str, int] = {}

    def add_job(self, job_id: str, data: Dict[str, Any]):
        self.jobs[job_id] = data
        self.retry_counts[job_id] = 0

    def process_job(self, job_id: str, processor: Callable[[Dict[str, Any]], Any]) -> bool:
        if job_id not in self.jobs:
            return False

        data = self.jobs[job_id]
        
        for attempt in range(4):
            try:
                processor(data)
                return True
            except Exception:
                if attempt < 3:
                    self.retry_counts[job_id] += 1
                    # Backoff: 1s (2^0), 2s (2^1), 4s (2^2)
                    delay = 2 ** (self.retry_counts[job_id] - 1)
                    if "delays" not in data:
                        data["delays"] = []
                    data["delays"]append(delay)
                else:
                    return False
        return False
```
</content>