可选择经典的动态规划题目,如Trapping rain water,若作为面试题可在面试者解题有困难时给予提示。
求笛卡尔积,输入int[][],输出int[][]。示范输入输出如下:
输入
{ { 1, 2, 3 }, { 3, 2 }, { 5, 6, 7 } }
输出
{
  { 1, 3, 5 },
  { 1, 2, 5 },
  { 1, 3, 6 },
  { 1, 2, 6 },
  { 1, 3, 7 },
  { 1, 2, 7 },
  { 2, 3, 5 },
  { 2, 2, 5 },
  { 2, 3, 6 },
  { 2, 2, 6 },
  { 2, 3, 7 },
  { 2, 2, 7 },
  { 3, 3, 5 },
  { 3, 2, 5 },
  { 3, 3, 6 },
  { 3, 2, 6 },
  { 3, 3, 7 },
  { 3, 2, 7 }
}
实现如下方法
public int[][] getCrossProduct(int[][] input) {
}
写一个线程安全、懒加载的单例,作为面试题可逐步提出要求,如先只要求写一个单例,再改造为懒加载的,再考虑线程安全。
String 类为什么被设计为 immutable?如果让你来设计,你会给 String 添加拷贝构造方法吗?为什么?
在一个Activity中,为了节省加载大图片的开销,做以下处理:
private static Drawable sBackground;
@Override
protected void onCreate(Bundle state) {
  super.onCreate(state);
  
  TextView label = new TextView(this);
  label.setText("Some text");
  
  if (sBackground == null) {
    sBackground = getDrawable(R.drawable.large_bitmap);
  }
  label.setBackgroundDrawable(sBackground);
  
  setContentView(label);
}
这样写有什么问题?
View hierarchy概念,视图树显示流程(先Measure,再Layout),调用的方法。触摸事件的处理流程,从Activity到父视图到子视图。
设计一个Section固定在顶部的ListView,关键思路,是用继承还是用组合,API设计,可能遇到的问题。
API设计能力,怎么方便使用者?实现思路,是起一个半透明的Activity,还是弹一个Dialog,还是其他?对可扩展性的考虑,以后需求需要在引导层做多步逻辑,应该怎么做。
坑的原因,遇到后怎么解决的,有什么办法可以避免。
request throttling, response out of order
JPEG for the photorealistic and PNG for screenshots.
comments powered by Disqus