Problem database last updated: June 20, 2025

TTencent logo

Tencent Coding Interview Questions

13 problems · 2 Easy, 9 Medium, 2 Hard · Ranked #120 of 458

Difficulty breakdown

2 Easy

15% · avg 23%

9 Medium

69% · avg 59%

2 Hard

15% · avg 18%

Top topics

stack
30.8%3.6x
array
30.8%
string
23.1%
hash-table
15.4%
linked-list
15.4%2.1x
database
15.4%13.7x

Interview profile

Based on 13 reported problems, Tencent interviews are in line with industry averages - 15% Hard vs 18% overall. The majority (69%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.

Compared to the industry average, Tencent puts unusual emphasis on database (15.4% of problems, 13.7x the industry average), stack (30.8% of problems, 3.6x the industry average), linked-list (15.4% of problems, 2.1x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are stack (30.8%), array (30.8%), string (23.1%), hash-table (15.4%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 13 problems

Decode String

Solve

Given an encoded string, return its decoded string.

MediumVery Likely
stringstackrecursion

Remove Boxes

Solve

You are given several boxes with different colors represented by different positive numbers.

HardVery Likely
arraydynamic-programmingmemoization

Candy

Solve

There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.

HardLikely
arraygreedy

Next Greater Element I

Solve

The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.

EasyLikely
arrayhash-tablestack

Remove Duplicates from Sorted List II

Solve

Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked li...

MediumLikely
linked-listtwo-pointers

LRU Cache

Solve

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.

MediumLikely
hash-tablelinked-listdesign

Debounce

Solve

Given a function fn and a time in milliseconds t, return a debounced version of that function.

MediumLikely

Immediate Food Delivery II

Solve

Table: Delivery

MediumLikely
database

Minimum Remove to Make Valid Parentheses

Solve

Given a string s of '(' , ')' and lowercase English characters.

MediumLikely
stringstack

Department Highest Salary

Solve

Table: Employee

MediumLikely
database

Merge Intervals

Solve

Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...

MediumLikely
arraysorting

Implement Rand10() Using Rand7()

Solve

Given the API rand7() that generates a uniform random integer in the range [1, 7], write a function rand10() that generates a uniform random integer in the rang...

MediumLikely
mathrejection-samplingrandomized

Valid Parentheses

Solve

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

EasyLikely
stringstack

How often are these problems asked?

Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Tencent interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Tencent coding interview

Tencent interviews focus heavily on stack, array, string problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.

Beyond solving problems, practice explaining your approach. Tencent interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Tencent ask in interviews?add

Tencent has been reported to ask 13 distinct coding problems. The most common topics are stack, array, string. 2 are Easy difficulty, 9 are Medium, and 2 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Tencent coding interviews?add

Based on 13 reported problems, Tencent interviews are in line with industry averages - 15% Hard vs 18% overall. 69% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.

How should I prepare for a Tencent coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: stack, array, string. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Tencent interview?

Simulate a real Tencent coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Tencent interview with AIarrow_forward