Problem database last updated: June 20, 2025

BBaidu logo

Baidu Coding Interview Questions

9 problems · 0 Easy, 5 Medium, 4 Hard · Ranked #167 of 458

Difficulty breakdown

0 Easy

0% · avg 23%

5 Medium

56% · avg 59%

4 Hard

44% · avg 18%

Top topics

dynamic-programming
88.9%4.5x
array
44.4%
hash-table
22.2%
string
22.2%
sliding-window
22.2%4.7x
greedy
22.2%2.6x

Interview profile

Based on 9 reported problems, Baidu interviews are significantly harder than average - 44% Hard vs 18% across all companies. The majority (56%) 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, Baidu puts unusual emphasis on memoization (22.2% of problems, 13.7x the industry average), sliding-window (22.2% of problems, 4.7x the industry average), dynamic-programming (88.9% of problems, 4.5x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are dynamic-programming (88.9%), array (44.4%), hash-table (22.2%), string (22.2%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 9 problems

Arithmetic Slices II - Subsequence

Solve

Given an integer array nums, return the number of all the arithmetic subsequences of nums.

HardVery Likely
arraydynamic-programming

Longest Substring with At Least K Repeating Characters

Solve

Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than o...

MediumVery Likely
hash-tablestringdivide-and-conquer

Integer Replacement

Solve

Given a positive integer n, you can apply one of the following operations:

MediumVery Likely
dynamic-programminggreedybit-manipulation

Split Array Largest Sum

Solve

Given an integer array nums and an integer k, split nums into k non-empty subarrays such that the largest sum of any subarray is minimized.

HardVery Likely
arraybinary-searchdynamic-programming

Arithmetic Slices

Solve

An integer array is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.

MediumVery Likely
arraydynamic-programmingsliding-window

Zuma Game

Solve

You are playing a variation of the game Zuma.

HardVery Likely
stringdynamic-programmingstack

Out of Boundary Paths

Solve

There is an m x n grid with a ball. The ball is initially at the position [startRow, startColumn]. You are allowed to move the ball to one of the four adjacent...

MediumVery Likely
dynamic-programming

Binary Tree Maximum Path Sum

Solve

A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequ...

HardVery Likely
dynamic-programmingtreedepth-first-search

Length of Longest Fibonacci Subsequence

Solve

A sequence x1, x2, ..., xn is Fibonacci-like if:

MediumVery Likely
arrayhash-tabledynamic-programming

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 Baidu interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Baidu coding interview

Baidu interviews focus heavily on dynamic-programming, array, hash-table 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. Baidu 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 Baidu ask in interviews?add

Baidu has been reported to ask 9 distinct coding problems. The most common topics are dynamic-programming, array, hash-table. 0 are Easy difficulty, 5 are Medium, and 4 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Baidu coding interviews?add

Based on 9 reported problems, Baidu interviews are significantly harder than average - 44% Hard vs 18% across all companies. 56% 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 Baidu coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: dynamic-programming, array, hash-table. 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 Baidu interview?

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

Simulate a Baidu interview with AIarrow_forward