ByteDance Backend Interview Experience: Key Topics and Knowledge Points
This article shares a detailed ByteDance backend interview experience covering three rounds, summarizing essential topics such as Java HashMap internals, Spring circular dependencies, MySQL indexing, OS process/thread concepts, networking protocols, TLS handshake, HTTP/2 features, and common design patterns, providing concise explanations and practical tips.
Interview Overview
Today I share a ByteDance backend interview experience covering three rounds; the candidate passed the first two but failed the third.
First Round Topics
Java: HashMap, exceptions, Spring circular dependencies, design patterns, synchronized
MySQL: indexes, SQL optimization, B+Tree
Operating System: processes and threads, soft/hard links, I/O multiplexing, fork principle, heap vs stack
Network: TCP/UDP, HTTPS handshake, HTTP/2, breakpoint resume, header fields
Hand‑written: algorithms (present in every round), Singleton pattern (appeared in third round)
HashMap Deep Dive
Difference between JDK 1.7 (array + linked list) and JDK 1.8 (array + linked list + red‑black tree when bucket size > 8, revert when < 6).
HashMap is not thread‑safe; to make it safe use synchronized, ConcurrentHashMap, ReentrantLock, ThreadLocal, etc.
In multithreaded environments JDK 1.7 may suffer linked‑list loops and data loss during resize; JDK 1.8 mitigates with tree bins but still has write‑overlap issues.
TLS Handshake Overview
Four‑step RSA‑based TLS handshake: ClientHello, ServerHello (certificate, randoms, cipher suite), ClientKeyExchange (pre‑master secret encrypted with server public key), ChangeCipherSpec and Finished messages. Illustrated with Wireshark captures.
Man‑in‑the‑middle attack description: attacker acts as proxy, presents forged certificate, if user accepts the warning the whole HTTPS session can be decrypted.
MySQL Indexes
Indexes accelerate data retrieval; types include B+Tree, Hash, Full‑text; physical storage: clustered (primary) vs secondary; field characteristics: primary, unique, normal, prefix; single‑column vs composite.
InnoDB uses B+Tree as default. Optimization tips: use EXPLAIN, create appropriate (composite) indexes, avoid leading wildcard, functions on indexed columns, drive large tables with small tables, pagination tricks, table partitioning.
Spring Circular Dependency
Three cases: constructor injection, setter injection in prototype scope, setter injection in singleton scope. Only the singleton setter case is resolved by Spring using a three‑level cache (singletonObjects, earlySingletonObjects, singletonFactories).
Cache structures are simple Map objects stored in DefaultSingletonBeanRegistry.
Operating System Links
Hard link: multiple directory entries point to same inode, cannot cross file systems, file is removed only when all links are deleted.
Soft link: separate inode containing path to target, can cross file systems, remains after target deletion (dangling).
Process vs Thread
Process is resource‑allocation unit; thread is execution unit. Processes have higher context‑switch cost and isolation; threads share memory, are lighter weight.
Fork Mechanism
Fork copies parent page table (virtual memory) using copy‑on‑write; physical pages are shared until a write triggers duplication.
Heap vs Stack
Heap: dynamic allocation, manual management, larger, slower. Stack: static allocation, automatic management, limited size, fast.
I/O Multiplexing
Single process can monitor many sockets using select/poll/epoll, handling each event within ~1 ms to achieve high concurrency.
TCP vs UDP
TCP is connection‑oriented, reliable, with flow control and congestion control; UDP is connectionless, faster, with no reliability guarantees.
HTTP/2 Features
Header compression (HPACK), binary framing, multiplexed streams, server push.
Additional Topics
Exception hierarchy in Java (Throwable → Error / Exception, checked vs unchecked)
Common design patterns: Singleton, Factory Method, Abstract Factory
Thread‑synchronization alternatives: ReentrantLock, volatile, atomic classes
HTTP range requests for breakpoint resume
Hand‑written coding tasks: rotate linked list, longest substring without repeat, singleton implementation, dynamic array‑based queue
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.
IT Services Circle
Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.
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.
