Code Room
Code reviewMediumcr-g119
Subject EncodingLevel Mid–Senior~25 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Python code that puts a token in a URL.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewpython
import base64, json def make_token(payload: dict) -> str:    raw = json.dumps(payload).encode('utf-8')    return base64.b64encode(raw).decode('ascii') def read_token(token: str) -> dict:    raw = base64.b64decode(token)    return json.loads(raw)
Run or narrate your approach, then ask the coach.