阿里巴巴计算机科学面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(15)
OOD(0)
Algorithm(0)
System Design(0)
高频题(0)
Math(0)
全部(15)
OOD(0)
Algorithm(0)
System Design(0)
高频题(0)
Math(0)
1.Partition Labels
2.Two Sum
3.Kth Largest Element in an Array
4.Set Matrix Zeroes
5.养殖问题
6.数组中最大数的期望
7.Trapping Rain Water
8.132 Pattern
9.无向图中是否存在环
10.Search in Rotated Sorted Array
11.leetcode157
12.Sudoku Solver
13.Search a 2D Matrix II
14.Excel Sheet Column Title
15.Interleaving String
1. Partition Labels
You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part.
Note that the partition is done so that after concatenating all the parts in order, the resultant string should be s.
Return a list of integers representing the size of these parts.
2. Two Sum
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
3. Kth Largest Element in an Array
Given an integer array nums and an integer k, return the kth largest element in the array.
Note that it is the kth largest element in the sorted order, not the kth distinct element.
You must solve it in O(n) time complexity.
4. Set Matrix Zeroes
Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's.
You must do it in place.
5. 养殖问题
给n个养鸡场,每个场里有不同数量的鸡,每场每天增加k只,每天结束后卖掉数量最多的场里一半的鸡(取floor),问m天过后所有场总共的鸡数。
比如,三个养鸡场 [100, 200, 400],每天增加k=100只,过m=3天后总共 [100, 200, 400] -> [200, 300, 250] -> [300, 200, 350] -> [400, 300, 225],400 + 300 + 225 = 925只。