Tencent Backend Interview Experience and Technical Knowledge Summary
The article details Tencent’s updated 15‑month compensation packages for 2025 backend roles, outlines a one‑hour interview covering OS process/thread concepts, sorting algorithms, MySQL storage engines and indexing, Redis data structures, Java collections, and compares RocketMQ with Kafka for reliable messaging.
Tencent has updated its salary structure: the housing allowance is now part of the base salary, the 13th month salary is spread across the base, and the year‑end bonus is reduced to three months, resulting in a 15‑month total compensation.
Typical offers for 2025 backend positions include:
SSP: 33k × 15 + 100k stock (2‑year vesting) + 60k signing bonus
SP: 30k × 15 + 60k stock + 30k signing bonus
Regular: 26k × 15
The interview covered about 30 questions plus a coding task, lasting over an hour. The knowledge areas tested were programming language fundamentals, computer basics, and backend components.
Operating System
Process vs. Thread
Fundamental difference : a process is the OS resource‑allocation unit; a thread is the execution unit.
Overhead : processes have separate memory spaces and higher context‑switch cost; threads share code/data and have lower switch cost.
Stability : a thread crash can bring down the whole process, while a child process crash does not affect its siblings.
Memory allocation : the OS allocates memory per process; threads use the memory of their owning process.
Containment : a process without threads is single‑threaded; a process with multiple threads runs multiple execution lines.
Data Structures
Sorting Algorithms and Complexity
Bubble sort – best O(n), average/worst O(n²), space O(1)
Insertion sort – best O(n), average/worst O(n²), space O(1)
Selection sort – O(n²) for all cases, space O(1)
Quick sort – best O(n log n), worst O(n²), average O(n log n), space O(log n) best, O(n) worst
Merge sort – O(n log n) for all cases, space O(n)
Heap sort – O(n log n) for all cases, space O(1)
Stable vs. Unstable Sorting
Stable sorts preserve the relative order of equal keys (e.g., merge sort); unstable sorts may reorder equal keys (e.g., quick sort).
MySQL
Storage Engines
InnoDB : supports transactions, foreign keys, crash recovery, row‑level locking.
MyISAM : fast inserts, low memory usage, no transaction support.
MEMORY : data kept in RAM, high speed, not durable.
Indexes
Primary (clustered) index stores full rows in leaf nodes.
Secondary indexes store only the primary key in leaf nodes.
Other index types: composite, prefix, unique.
Index Invalidations
LIKE patterns with leading % (e.g., like %xx )
Functions or expressions applied to indexed columns
Implicit type conversion in comparisons
Violating left‑most prefix rule in composite indexes
Transaction Isolation Levels
Read Uncommitted – allows dirty reads.
Read Committed – prevents dirty reads.
Repeatable Read – prevents dirty and non‑repeatable reads (default in InnoDB).
Serializable – prevents all three anomalies.
MVCC Implementation
Read View records min_trx_id , max_trx_id , and a list of active transaction IDs ( m_ids ). Visibility rules are based on comparisons between a row’s trx_id and these values.
Redis
Data Types
String, Hash, List, Set, Sorted Set (Zset)
Extended types: BitMap, HyperLogLog, GEO, Stream
Hot Key Mitigation
Enable LRU eviction.
Set expiration times.
Shard hot keys across multiple nodes.
String Implementation (SDS)
Redis stores strings using the SDS structure, which keeps len , alloc , and flags alongside the buffer. This provides O(1) length retrieval, binary safety, and automatic buffer expansion, avoiding C‑string overflow issues.
Java
Compiled vs. Interpreted Languages
Compiled languages are translated to machine/byte code before execution (fast, less portable). Interpreted languages are executed line‑by‑line at runtime (portable, slower).
Dynamic Arrays
ArrayList and Vector are dynamic arrays; Vector is synchronized, ArrayList is not. Expansion factor: ArrayList grows by 1.5×, Vector by 2×.
HashMap Rehashing
Java 7: rehash when size ≥ threshold *and* a new entry causes a hash collision.
Java 8: rehash when size ≥ threshold (single condition).
Message Queues (MQ)
RocketMQ Selection
Java‑centric ecosystem.
Active community and Alibaba backing.
Rich feature set (ordered, transactional, delayed messages, etc.).
Reliability Guarantees
Producer retries on ack failure.
Broker replication across nodes.
Consumer acknowledges after successful processing.
Kafka vs. RocketMQ
Kafka ACK levels: 0 (none), 1 (leader only), -1 (all replicas).
RocketMQ offers synchronous, asynchronous, and one‑way send modes.
Broker architecture: Kafka brokers are independent; RocketMQ brokers have master‑slave clusters.
Java Tech Enthusiast
Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!
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.