• 第一次笔试【面试】


    前言

    2022/10/21收到笔试邀请
    要求
    在2022/10/22 23:59前做好笔试。

    该文章,作于2022/10/22。
    该文章,将在2022/10/23发布。

    笔试邀请

    在这里插入图片描述

    笔试环境

    ALL

    • 开启摄像头
    • 不能分屏,会检测次数

    编程

    • 不能复制
    • 不能table
    • 只有一个输入框

    题目(60min)

    单选题、多选题、判断题

    记不清考了啥。
    他好像什么都考了,又好像什么都没考。

    数据库、操作系统、网络、Java,
    自我感觉:沾点边边,有点关系。

    金融相关单选题

    编程题

    数据库

    有三个表

    Goods 货物表

    字段说明
    GoodsId货物编号
    Name货物名称
    TypeId货物类型
    Stock库存数量

    Type 类型表

    字段说明
    TypeId类型Id
    Name类型名称
    UpId上属类型id

    Order 订单表

    字段说明
    OrderId订单id
    GoodsId货物id
    Date日期

    题目大概,有点记不清了

    (1) 求货物名以“新品开头”并且库存大于0的货物名称、属性名称、上属名称

    (2)求货物类型是“化妆品”的商品的名称、库存剩余。(库存剩余=库存-销量)

    (3)求销量前三的货物名和销量。(销量有可能相同)

    回忆一下,我写的

    #(1)连接和自连接
    select g.Name,t.Name,u.Name
    from Goods g
    inner join Type t
    on g,GoodsId=t.GoodsId
    inner join Type u
    on t.UpId=u.TypeId
    where g.Name like "新品%"
    and g,Stock>0;
    
    #(2) select字段中有运算符应该不对
    select Name,(Stock-cnt) "yuliang"
    from Goods g
    inner join Type t
    on g.GoodsId=t.GoodsId
    inner join(
    		select GoodsId,count(OrderId) "cnt"
    		from Order o
    		inner join Goods g
    		on o.GoodsId=g.GoodsId
    		group by GoodsId
    ) a
    on g.GoodsId=a.GoodsId
    where t.Name="化妆品";
    
    
    #(3) 求出销量第三的值,返回比其大的货物
    select g.Name,a.cnt
    from Goods g
    inner join(
    	select GoodsId,count(OrderId)"cnt"
    	from Order o
    	inner join Goods g
    	group by g.GoodsId
    	having count(OrderId)>(
    		select count(OrderId)
    		from Order o
    		inner join Goods g
    		on o.GoodsId=g.GoodsId
    		group by o.GoodsId
    		order by count(OrderId)
    		limit 2, 1
    	) 
    ) a
    on g.GoodsId=a.GoodsId;
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46

    突然看见sql格式
    Order Type 都是关键字,要用着重号“`”引起来,
    完了,彻底寄了

    算法

    给你一系列邮箱,去重邮箱,
    得到不重复的邮箱

    两个重复规则 . +
    
    规则 . 
    “123456.@123.com”,
    点(.)可以省略,
    等同于"123456@123.com“
    
    规则 +
    “123456+a@123.com”+
    及其后面的字符可以省略,
    等同于"123456@123.com”
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    我当时写的,当时脑袋有点蒙,忘记了String有哪些方法了。

    回忆一下,当时写的和这个下面的代码差不多

    public quchong(String[] emails){
    	Set<String> set=new HashSet<>();
    	for(String s:email){
    		set.add(change(s));
    	}
        for(String s:set){
    		System.out.println(s);
    	}
    }
    
    public String change(String s){
    	int flagAt=0;
    	int flagAdd=0;
    	for(int i=0;i<s.length;i++){
    		if(flagAt==1){
    			break;
    		}
    		if(s.chatAt(i)=='.'&&flagAt==0){
    			s.chatAt(i)='';
    			continue;
    		}
    		if(s.chatAt(i)=='+'&&flagAt==0){
    			s.chatAt(i)='';
    			flagAdd=1;
    			continue;
    		}
    		if(flagAdd==1){
    		    s.chatAt(i)='';
    		}
    		if(s.chatAt(i)=='@'&&flagAt==0){	
    			flagAt=1;
    			break;
    		}
    
    	}
    
    
    
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40

    性格测试(30min)

    88题

    选出下面三个最符合和最不符合的选项。

    最后

    我主要复习的是Java相关的。
    JavaSE、JUC、数据库、算法。

    事实证明考试的好不好和你复习好不好没有关系

    因为考的是你没有复习的或者你根本不知道的,
    主要是看平时积累了。

  • 相关阅读:
    Java高性能本地缓存框架Caffeine
    java 字节流写入文件内容实现换行
    Cortex-M4中的Tail-chaining(末尾连锁)和Late-arriving(迟到异常)
    知识点滴 - 关于汉语学习的网络资源
    用生活的栗子去理解JavaScript的Prmoise更通俗易懂
    跨平台编译GSL(Windows、Linux、MacOS环境下编译与安装)
    长风破浪会有时,直挂云帆济沧海!(工作室年会总结)
    车载摄像头CAM
    virualBox虚拟机系统磁盘fdisk无损扩容
    如何批量压缩图片大小?教你3个批量压缩图片的方法
  • 原文地址:https://blog.csdn.net/qq_51625007/article/details/127467187