Master FTP Login Methods & Python Memory Management: Interview Answers Explained
This article presents two common interview questions—one on FTP login methods and commands, and another on Python memory management mechanisms—providing detailed explanations and answers to help programmers improve their interview performance and understand underlying concepts.
Question 1 (Linux)
Describe the two login methods when using FTP for file transfer and explain their differences.
List common FTP file transfer commands.
Answer 1
FTP has two login methods: anonymous login and authenticated login.
Anonymous login uses username anonymous and any valid email address as password; it can only access resources in the FTP directory, typically allowing download only.
Authenticated login uses a real user account and password on the remote system; it provides broader permissions, allowing both upload and download.
FTP also supports two transfer modes: ASCII mode for text files and binary mode for other files.
Common FTP commands include: bin, asc, put, get, mput, mget, prompt, bye.
Question 2 (Python)
How does Python manage memory?
Answer 2
Python’s memory management consists of three mechanisms: reference counting, garbage collection, and memory pooling.
Reference counting : every object has a reference count that increases when a new name is bound to it or when it is placed in a container, and decreases when a name is deleted or goes out of scope. The sys.getrefcount() function returns the current count.
Garbage collection : when an object’s reference count drops to zero it is reclaimed; cyclic references are detected by a periodic collector that breaks cycles to prevent memory leaks.
Memory pooling : Python uses the pymalloc allocator for small objects (≤256 bytes), keeping freed memory in private pools rather than returning it to the OS. Large objects use the system malloc. Separate pools exist for different object types such as integers, floats, and lists.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
