一面腾讯pcg凉经

一面腾讯pcg凉经
1. 上来撸项目,巴拉巴拉大半天,小哥哥非常耐心。听我罗里吧嗦的答了很多。
2. redis缓存穿透,分三个层面,最外层布隆过滤器,再往里使用缓存一些无效的key,(没答上来参数校验,鉴权什么的),穿透可能是因为大量的key同时过期,
就可以将数据过期的时间加上一个随机值
3. es搜索的流程。query和fetch操作
4. Lucene搜索的流程
5. Lucene 倒排索引结构
6. mysql 查询的比较慢,调优如何做
7. 跨域如何做的,后端如何处理
8. 输入baidu.com。每层上用什么协议
9.算法 九宫格实现。之前装逼说很简单,结果bug没调出来。尴尬脸。太惨。最后说了一下想法。
10. java多线程使用。线程池如何创建。
11. java如何解决死锁。(没答上来)
算法没做出来,估计是没戏了。🤣🤣🤣🤣
不得不说,腾讯面试官真的好。非常nice。说话温柔,不打断,还“请教一下,请问一下”。我爱了。
厚着脸皮祈求二面吧。 😊😊😊😊
调试完bug的代码放过来了吧。😂😂😂 大佬轻喷

package company.tencent;

public class NineBlock {
    private static int[][] ma = new int[3][3];
    private static int[] st = new int[10];

    public static void main(String[] args) {
        dfs(0, 0);
    }

    private static void dfs(int x, int y) {
        int xx = x, yy = y;
        if (y == 3) {
            xx += 1;
            yy = 0;
        }
        if (xx == 3) {
            if (check(ma)) {
                print(ma);
            }
            return;
        }

        for (int i = 1; i <= 9; i++) {
            if (st[i] == 0) {
                st[i] = 1;
                ma[xx][yy] = i;
                dfs(xx, yy + 1);
                st[i] = 0;
                ma[xx][yy] = 0;
            }
        }
    }

    private static boolean check(int[][] ma) {
        int[] colVal = new int[3];
        int[] rowVal = new int[3];
        int[] ancel = new int[2];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                colVal[i] += ma[j][i];
            }
            if (colVal[i] != 15) return false;
        }
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                rowVal[i] += ma[i][j];
            }
            if (rowVal[i] != 15) return false;
        }

        ancel[0] = ma[0][2] + ma[1][1] + ma[2][0];
        ancel[1] = ma[0][0] + ma[1][1] + ma[2][2];
        for (int i = 0; i < 2; i++) {
            if (ancel[i] != 15) return false;
        }

        return true;
    }

    private static void print(int[][] ma) {
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(ma[i][j] + " ");
            }
            System.out.println();
        }
    }

}


#面经##校招##Java工程师#
全部评论
请问,腾讯面试这么晚吗
点赞
送花
回复
分享
发布于 2020-09-29 08:54
我也重新被捞,不太想面了心累,上次都云证完了,现在重新开始,害😕
点赞
送花
回复
分享
发布于 2020-09-29 09:57
秋招专场
校招火热招聘中
官网直投
有预约面试吗
点赞
送花
回复
分享
发布于 2020-09-29 10:19
楼主面的哪个部门
点赞
送花
回复
分享
发布于 2020-10-08 15:26
大佬是腾讯会议面的吗,怎么撕代码呀
点赞
送花
回复
分享
发布于 2020-10-27 21:02

相关推荐

头像
05-14 12:29
安卓
点赞 评论 收藏
转发
1 7 评论
分享
牛客网
牛客企业服务