# Encode the greeting to UTF-8 bytes

Canonical URL: <https://datadriven.io/problems/encode-the-greeting-to-utf-8-bytes-print-the-type-of-the-en-ecb2b093>

Domain: Python · Difficulty: medium

## Problem

Encode the greeting to UTF-8 bytes. Print the type of the encoded result. Print the byte length. Then decode it back and compare to the original string using ==, printing the boolean result.

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/encode-the-greeting-to-utf-8-bytes-print-the-type-of-the-en-ecb2b093)
- [Python Interview Questions](https://datadriven.io/python-interview-questions)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.