Baidu Interview Questions

Baidu Interview Guides

Click or hover over a slice to explore questions for that topic.
Data Structures & Algorithms
(1)

Baidu Interview Questions

Practice for the Baidu interview with these recently asked interview questions.

QuestionTopicDifficulty
Data Structures & Algorithms
Medium

Binary Tree Validation

You are given the root of a binary tree. You need to determine if it is a valid binary search tree (BST).

A valid BST is defined as follows:

  • The left subtree of a node contains only nodes with values less than or equal to the node’s value.
  • The right subtree of a node contains only nodes with values greater than or equal to the node’s value.
  • Both the left and right subtrees must also be binary search trees.

Given the function def is_valid_bst(root: Node) -> bool:, return True if the binary tree is a valid BST. Otherwise, return False.

Example:

Input:

imageConverted Binary Tree.png

Output:

def is_valid_bst(Node(3)) -> True
Loading pricing options

View all Baidu questions

Challenge

Check your skills...
How prepared are you for working at Baidu?

Baidu Salaries by Position

Data Scientist*
$135K
$201K
Data Scientist
Median: $168K
Mean (Average): $168K
Data points: 2
$150K
$190K
AI Research Scientist
Median: $167K
Mean (Average): $167K
Data points: 20
$134K
$158K
Software Engineer
Median: $150K
Mean (Average): $147K
Data points: 3
$73K
$178K
ML Engineer
Median: $148K
Mean (Average): $139K
Data points: 8
Data Engineer*
$75K
Data Engineer
Median: $75K
Mean (Average): $75K
Data points: 1
Business Analyst*
$74K
Business Analyst
Median: $74K
Mean (Average): $74K
Data points: 1

Most data science positions fall under different position titles depending on the actual role.

From the graph we can see that on average the Data Scientist role pays the most with a $167,900 base salary while the Business Analyst role on average pays the least with a $73,848 base salary.

Discussion & Interview Experiences

?
There are no comments yet. Start the conversation by leaving a comment.

Discussion & Interview Experiences

There are no comments yet. Start the conversation by leaving a comment.

Jump to Discussion