360系统部大数据一面

1. hdfs如果小文件多了会有什么后果??

2. hdfs的NameNode的启动过程

3. NameNode管理什么数据??详细

4. hdfs中路径的表示

5. Linux下服务不响应应该怎么排查

netstat
top
iostat
查看进程打开哪些文件的命令

6. 问了下RAID级别

raid0和raid5

7. == 和 equals的区别

老生常谈

8. HashMap可以用对象做Key吗?

可以。需要重写hashCode方法和Equals方法

9. 撸代码题

9.1 归并排序的merge操作

9.2 你自己实现String的equals函数

public class String 
{
    public char[] chars;
    
    public boolean equals(String str)
    {
        //null
       // if(str == null)
        //{
            
        //}
        
        //==
        if(this.chars == str.chars)
        {
            return true;
        }
        //length
        if(this.chars.length != str.chars.length)
        {
            return false;
        }
        //check content
        for(int i=0;i<this.chars.length;i++)
        {
            if(this.chars[i] != str.chars[i])
            {
                return false;
            }
        }
        return true;
    }
    
    public static int[] merge(int[] nums1,int[] nums2)
    {
        int[] res = new int[nums1.length+nums2.length];
        int i=0,j=0;
        int k=0;
        while(i<nums1.length && j<nums2.length)
        {
            if(nums1[i] <= nums2[j])
            {
                res[k++] = nums1[i++];
            }
            else //if(nums2[j] < nums1[i])
            {
                res[k++] = nums2[j++];
            }
        }
        while(i<nums1.length)
        {
            res[k++] = nums1[i++];
        }
        while(j<nums2.length)
        {
            res[k++] = nums2[j++];
        }
        
        return res;
    }
    
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值