⭐️vivo2024校招面经,很简单
约 9586 字大约 32 分钟
2025-04-24
面试题
1、自我介绍
2、介绍自己的实习经历,做了什么,学到了什么
3、重载和重写什么区别?项目中用到了吗?
4、构造方法可以有多个吗?能被重写吗?
<font style="color:rgb(59, 69, 78);">void</font>
5、接口和抽象类如何选择?为什么?
接口和抽象类的共同点
接口和抽象类的区别
<font style="color:rgb(59, 69, 78);">public static final</font><font style="color:rgb(59, 69, 78);">private</font><font style="color:rgb(59, 69, 78);">protected</font><font style="color:rgb(59, 69, 78);">public</font>- ````````
public interface MyInterface {
default void defaultMethod() {
System.out.println("This is a default method.");
}
}public interface MyInterface {
static void staticMethod() {
System.out.println("This is a static method in the interface.");
}
}public interface MyInterface {
// default 方法
default void defaultMethod() {
commonMethod();
}
// static 方法
static void staticMethod() {
commonMethod();
}
// 私有静态方法,可以被 static 和 default 方法调用
private static void commonMethod() {
System.out.println("This is a private method used internally.");
}
// 实例私有方法,只能被 default 方法调用。
private void instanceCommonMethod() {
System.out.println("This is a private instance method used internally.");
}
}6、什么是序列化?什么是反序列化?
****


7、为什么用索引?如何创建索引?哪些字段适合创建索引?
-- 创建索引
CREATE INDEX order_id_index ON cus_order (id);
-- 创建唯一索引 (假设 order_no 字段需要保证唯一性)
CREATE UNIQUE INDEX order_order_no_unique_index ON cus_order (order_no);
-- 删除索引
ALTER TABLE cus_order DROP INDEX order_id_index;
-- 其他字段的索引示例
ALTER TABLE cus_order ADD INDEX order_customer_id_index (customer_id);
ALTER TABLE cus_order ADD INDEX order_create_time_index (create_time);
-- 覆盖索引示例 (假设查询语句经常用到 score, name, amount)
CREATE INDEX order_score_name_amount_index ON cus_order (score, name, amount);8、如何分析 SQL 性能?
``****<font style="color:rgb(59, 69, 78);">EXPLAIN</font>
<font style="color:rgb(59, 69, 78);">EXPLAIN</font><font style="color:rgb(59, 69, 78);">SELECT</font><font style="color:rgb(59, 69, 78);">DELETE</font><font style="color:rgb(59, 69, 78);">INSERT</font><font style="color:rgb(59, 69, 78);">REPLACE</font><font style="color:rgb(59, 69, 78);">UPDATE</font><font style="color:rgb(59, 69, 78);">SELECT</font>
<font style="color:rgb(59, 69, 78);">EXPLAIN</font>
mysql> EXPLAIN SELECT `score`,`name` FROM `cus_order` ORDER BY `score` DESC;
+----+-------------+-----------+------------+------+---------------+------+---------+------+--------+----------+----------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-----------+------------+------+---------------+------+---------+------+--------+----------+----------------+
| 1 | SIMPLE | cus_order | NULL | ALL | NULL | NULL | NULL | NULL | 997572 | 100.00 | Using filesort |
+----+-------------+-----------+------------+------+---------------+------+---------+------+--------+----------+----------------+
1 row in set, 1 warning (0.00 sec)9、 线程的状态有哪些?如何理解?
- ``
- ``


- ``****
<font style="color:rgb(59, 69, 78);">sleep(long millis)</font><font style="color:rgb(59, 69, 78);">wait(long millis)</font>- ````````****
- ``****
10、为什么不直接创建线程?自定义线程池需要指定哪些参数?重要性如何?
****
**<font style="color:rgb(59, 69, 78);">ThreadPoolExecutor</font>**
**<font style="color:rgb(59, 69, 78);">corePoolSize</font>****<font style="color:rgb(59, 69, 78);">maximumPoolSize</font>****<font style="color:rgb(59, 69, 78);">workQueue</font>**
<font style="color:rgb(59, 69, 78);">ThreadPoolExecutor</font>
**<font style="color:rgb(59, 69, 78);">keepAliveTime</font>**<font style="color:rgb(59, 69, 78);">corePoolSize</font><font style="color:rgb(59, 69, 78);">keepAliveTime</font>**<font style="color:rgb(59, 69, 78);">unit</font>**<font style="color:rgb(59, 69, 78);">keepAliveTime</font>**<font style="color:rgb(59, 69, 78);">threadFactory</font>****<font style="color:rgb(59, 69, 78);">handler</font>**

11、垃圾回收算法有哪些?
标记-清除算法

复制算法

标记-整理算法

分代收集算法
12、字符串常量池什么作用?
// 在字符串常量池中创建字符串对象 ”ab“
// 将字符串对象 ”ab“ 的引用赋值给给 aa
String aa = "ab";
// 直接返回字符串常量池中字符串对象 ”ab“,赋值给引用 bb
String bb = "ab";
System.out.println(aa==bb); // true

13、谈谈你用到的设计模式,为什么用?
更新: 2024-10-20 17:05:25
原文: https://www.yuque.com/snailclimb/mf2z3k/pthvaf31mtwu98bn
更新日志
2026/5/5 18:19
查看所有更新日志
fde06-docs: 添加 doc 技术文档于
