<reasoning_content>
*   Extend an existing `JobQueue` class (implied, though the base class isn't provided in the prompt, I should define a minimal one to make the code runnable or assume a standard structure).
    *   Method to add: `process_job(job_id: str, Processor: Callable) -> bool`.
    *   Logic:
        *   Get `data` associated with `job_id`.
        *   Call `processor(data)`.
        *   Retry on exception.
        *   Max 4 total attempts (1 initial + 3 retries).
        *   Retry counts per job.
        *   Exponential backoff: 1s, 2s, 4s (delays recorded as data).
        *   No actual `time.sleep`.
        *   Return `True` on success, `False` on final failure.
    *   Constraints: Standard library only, no explanations.

    *   `jobs`: A dictionary mapping `job_id` to its data/metadata.
    *   `add_job(job_id, data)`: Standard way to put jobs in.
    *   `process_job(job_id, processor)`: The new method.

    *   Need a way to store retry count? The prompt says "Track the retry count per job". I can store this in the dictionary value.
    *   "Record the delays as data": Does this mean updating the data dict or just internal tracking? The prompt says "record the delays as data". This usually means updating the dictionary associated with that ID.

    *   Max attempts = 4.
    *   Attempts: 1 (initial), 2 (retry 1), 3 (retry 2), 4 (retry 3).
    *   Delays: 1, 2, 4.
    *   Exception handling: `try...except`.

    *   `JobQueue` class definition.
    *   `jobs` dict.
    *   `add_job` method.
    *   `process_job` method.

    *   Job 1: Attempt 1 -> Fail -> Delay 1s -> Attempt 2 -> Fail -> Delay 2s -> Attempt 3 -> Fail -> Delay 4s -> Attempt 4 -> Fail -> Return False.
    *   Job 2: Attempt 1 -> Success -> Return True.

    *Refining the "record delays as data" instruction*:
    The prompt says: "Track the retry count per job... Record the delays as data."
    I will assume the job data dict contains `retry_count` and `last_delay`.

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

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

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

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

            job_data = self.jobs[job_id]
            # Initialize metadata if not present
            if "retry_count" not in job_data:
                job_data["retry_count"] = 0
            if "delays" not in job_data:
                job_data["delays"] = []

            max_attempts = 4
            delays = [1, 2, 4]

            for attempt in range(max_attempts):
                try:
                    processor(job_data)
                    return True
                except Exception:
                    if attempt < max_attempts - 1:
                        # Calculate delay for the next attempt
                        # Attempt 0 fail -> Delay index 0 (1s)
                        # Attempt 1 fail -> Delay index 1 (2s)
                        # Attempt 2 fail -> Delay index 2 (4s)
                        delay = delays[attempt]
                        job_data["retry_count"] += 1
                        job_data["delays"].append(delay)
                    else:
                        # Final attempt failed
                        break

            return False
    ```

    Wait, "Track the retry count per job" and "Record the delays as data" - does "data" mean the `data` passed in `add_job`? Yes.

    Let's double check the logic:
    Attempt 0 (Initial): `processor` fails. `retry_count` becomes 1. `delays` gets `1`.
    Attempt 1 (Retry 1): `processor` fails. `retry_count` becomes 2. `delays` gets `2`.
    Attempt 2 (Retry 2): `processor` fails. `retry_count` becomes 3. `delays` gets `4`.
    Attempt 3 (Retry 3): `processor` fails. Loop ends. Return False.

    Wait, if attempt 0 fails, the count is 1. If attempt 1 fails, count is 2. If attempt 2 fails, count is 3.
    If it succeeds on attempt 3, it returns True.

    Let's refine the loop to be more precise with indices.

    ```python
    def process_job(self, job_id: str, processor: Callable) -> bool:
        if job_id not in self.jobs:
            return False

        job_data = self.jobs[job_id]
        if "retry_count" not in job_data:
            job_data["retry_count"] = 0
        if "delays" not in job_data:
            job_data["delays"] = []

        delays = [1, 2, 4]

        for attempt_idx in range(4):
            try:
                processor(job_data)
                return True
            except Exception:
                if attempt_idx < 3:
                    job_data["retry_count"] += 1
                    job_data["delays"].append(delays[attempt_idx]))
                else:
                    return False
        return False
    ```

    Check requirements again:
    1. Call `processor(data)` where `data` is the dict passed to `add_job`.
    2. Retry on exception. Max 4 attempts (initial + 3 retries).
    3. Track retry count. Exponential backoff (1, 2, 4).
    4. Do NOT actually sleep — record the delays as data.
    5. Return True on first success. False if all 4 fail.

    One detail: "Track the retry count per job". If I call `process_job` multiple times for the same ID? The code should probably increment based on existing count or reset? Usually, processing a job is a singular event. I'll assume it starts from where it left off or initializes if empty.

    Also, the prompt says "record the delays as data".
    If `job_data` is `{ "id": 1 }`, and it fails, it becomes `{ "id": 1, "retry_count": 1, "delays": [1] }`.

    Python code only. No explanations.

    Wait, `Callable` is from `typing`. I should include that.

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

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

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

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

            job_data = self.jobs[job_id]
            
            if "retry_count" not in job_data:
                job_data["retry_count"] = 0
            if "delays" not in job_data:
                job_data["delays"] = []

            delays = [1, 2, 4]
            
            for attempt in range(4):
                try:
                    processor(job_data)
                    return True
                except Exception:
                    if attempt < 3:
                        job_data["retry_count"] += 1
                        job_data["delays"].append(delays[attempt]))
                    else:
                        return False
            return False
    ```

    One small detail: "Retry on any exception". `Exception` is the standard.

    Is `processor` supposed to be a specific signature? `Callable`.
    Is `job_id` a string? Yes.

 you can also use `Callable` from `typing`.

    One minor check:
    If `attempt` is 0 (Initial):
    - Exception occurs.
    - `attempt < 3` is true.
    - `retry_count` becomes 1.
    - `delays` gets `delays[0]` which is 1.
    Attempt 1:
    - Exception occurs.
    - `attempt < 3` is true.
    - `retry_count` becomes 2.
    - `delays` gets `delays[1]` which is 2.
    Attempt 2:
    - Exception occurs.
    - `attempt < 3` is true.
    - `retry_count` becomes 3.
    - `delays` gets `delays[2]` which is 4.
    Attempt 3:
    - Exception occurs.
    - `attempt < 3` is false.
    - returns False.

    Matches requirements.

    Wait, "Track the retry count per job". Does this mean the `retry_count` should be shared across multiple `process_job` calls if they are called separately? Usually, a job is processed until success or failure. If I call `process_job` and it fails, it retries internally. If I call it again, should it start from 0 or continue?
    The prompt says "Track the retry count per job". If it's stored in the dictionary, it persists. If the user calls `process_job` again on a job that already has a `retry_count` of 3, it should probably start from 3?
    Or does `process_job` complete the whole lifecycle (4 attempts)?
    "Return False if all 4 attempts raise."
    This implies the 4 attempts happen within one call to `process_job`.
    If the logic is internal, then the "Track per job" refers to the state inside that specific process call.

    Wait, if I call `process_job` and it fails 3 times and then I call it again, the `retry_count` would be 3. If the loop starts at 0, it might try 4 more times?
    To be safe, I'll make sure the `retry_count` reflects the total count during that specific call, or simply initialize if not present.

    Actually, most interview-style questions like this imply a single call completes the attempt cycle.

    Final check on "record the delays as data":
    `job_data` is the dict passed to `add_job`.
    If I update `job_data` in place, it updates the dict in `self.jobs`. This is correct.

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

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

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

        def process_job(self, job_id: str, processor: Callable[[Dict[str, Any]], Any]) -> bool:
            if job_id not in self.jobs:
                return False
            
            job_data = self.jobs[job_id]
            
            if "retry_count" not in job_data:
                job_data["retry_count"] = 0
            if "delays" not in job_data:
                job_data["delays"] = []
            
            delays = [1, 2, 4]
            
            for attempt_idx in range(4):
                try:
                    processor(job_data)
                    return True
                except Exception:
                    if attempt_idx < 3:
                        job_data["retry_count"] += 1
                        job_data["delays"].append(delays[attempt_idx]))
                    else:
                        return False
            return False
    ```
    Wait, the `delays` list has 3 elements. `attempt_idx` goes 0, 1, 2, 3.
    When `attempt_idx` is 0, 1, 2, it appends. When it is 3, it doesn't.
    This is perfect.

    One tiny thing: `Callable[[Dict[str, Any]], Any]` or just `Callable`. The prompt says `Callable`. I'll use `Callable` for simplicity or `Callable[[Dict[str, Any]]]` to be safe.

    Actually, I'll stick to the signature provided in the prompt: `process_job(job_id: str, Processor: Callable) -> bool`. Note: prompt uses capital `Processor`. I should keep that.

    Prompt: `process_job(job_id: str, Processor: Callable) -> bool`.
    The prompt uses `Processor` (Capital P). I will follow that exactly.

    Wait, I should check if the `retry_count` should be initialized if it exists. If `retry_count` is already 2 (from a previous call), and we start a new `process_job` call, should it continue?
    The prompt says "Return False if all 4 attempts raise". This suggests a fresh count of 4 within the method.
    I'll stick to the logic that it handles 4 attempts within the call.

    One last check: "Record the delays as data".
    If I use `job_data["delays"] = [...]`, that is recording it.

    Code structure:
    ```python
    from typing import Callable, Dict, Any

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

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

        def process_job(self, job_id: str, Processor: Callable) -> bool:
            if job_id not in self.jobs:
                return False
            
            job_data = self.jobs[job_id]
            
            if "retry_count" not in job_data:
                job_data["retry_count"] = 0
            if "delays" not in job_data:
                job_data["delays"] = []
            
            backoff_delays = [1, 2, 4]
            
            for attempt in range(4):
                try:
                    Processor(job_data)
                    return True
                except Exception:
                    if attempt < 3:
                        job_data["retry_count"] += 1
                        job_data["delays"]append(backoff_delays[attempt]))
                    else:
                        return False
            return False
    ```
    Wait, I used `delays` then changed to `backoff_delays`. I'll use `delays`.
    Wait, `job_data["delays"]append` is a typo. Should be `job_data["delays"].append(...)`.
</reasoning_content>

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

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

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

    def process_job(self, job_id: str, Processor: Callable) -> bool:
        if job_id not in self.jobs:
            return False
        
        job_data = self.jobs[job_id]
        
        if "retry_count" not in job_data:
            job_data["retry_count"] = 0
        if "delays" not in job_data:
            job_data["delays"] = []
            
        delays = [1, 2, 4]
        
        for attempt in range(4):
            try:
                Processor(job_data)
                return True
            except Exception:
                if attempt < 3:
                    job_data["retry_count"] += 1
                    job_data["delays"].append(delays[attempt]))
                else:
                    return False
        return False
```
</content>