美团lastday,说说我的实习感悟

时间过得真快啊,一转眼就在团子呆了4个多月了,我的大厂梦要告一段落了,下月又要开启下一段实习了(不是大厂哈)

工作强度:一般都是早10晚8,一个天天吵吵说实习不加班的人,现在也可以看到8、9点再走了,感谢团子提高了我的抗压能力团队氛围:mentor姐姐(很美腻)不pua我 性格非常好 leader时不时会转着圈发点零食

福利待遇:虽然总被说开水厂 但实习薪资也算在大厂平均数以上了 办公地点在朝阳区的 通勤距离也还算可以接受 而且我的岗位工作并不累。最近还行,活动还挺多的, 吃到过冰棍,还有抽奖什么的,还有奶茶喝,也是没想到实习期间还遇上铁公鸡拔毛了(其实意思是感觉员工待遇在提升哈

#一起聊美团#
全部评论
怎么又要去其他公司实习,咋不留在美团
点赞 回复 分享
发布于 09-18 19:30 陕西

相关推荐

import java.util.*;class Node {public Integer key;public Integer value;public Long timeStamp;public Node(Integer key, Integer value, Long timeStamp) {this.key = key;this.value = value;this.timeStamp = timeStamp;}}class LRUCache {private Map<Integer, Node> map;private int capacity;public LRUCache(int capacity) {map = new LinkedHashMap<>();this.capacity = capacity;}public int get(int key) {Node node = map.get(key);// key 不存在if (node == null) {return -1;}// key 过期(懒删除策略)if (isExpire(node)) {map.remove(key);return -1;}map.remove(key);map.put(key, node);return node.value;}public void put(int key, int value, Long timeStamp) {Node node = map.get(key);if (node == null) {  // key 不存在node = new Node(key, value, timeStamp);if (map.size() < capacity) {  // 有额外空间map.put(key, node);} else {  // 没有额外空间// 先尝试移除过期keyremoveExpireNodes();// 如果空间还是不足,移除最老的keyif (map.size() >= capacity) {map.remove(map.keySet().iterator().next());}map.put(key, node);}} else {  // key 存在map.remove(key);node = new Node(key, value, timeStamp);map.put(key, node);}}private void removeExpireNodes() {for (Node node : map.values()) {if (isExpire(node)) {map.remove(node.key);}}}private boolean isExpire(Node node) {if (node.timeStamp == null) {  // 没有时间戳表示永久不过期return false;}return System.currentTimeMillis() > node.timeStamp;}}class LRUTTL {public static void main(String[] args) {LRUCache cache = new LRUCache(2);cache.put(1, 10, null);cache.put(2, 20, null);System.out.println(cache.get(1));  // 10cache.put(3, 30, null);System.out.println(cache.get(2));  // -1cache.put(4, 40, System.currentTimeMillis() + 1000);try {System.out.println(cache.get(1));  // -1Thread.sleep(1500);System.out.println(cache.get(3));  // 30System.out.println(cache.get(4));  // -1} catch (InterruptedException e) {throw new RuntimeException(e);}}}优化点:可以维护一个map结构存储<最小过期时间,节点数量>来判断当前LinkedList中是否存在已经过期的node,可以一定程度地减少 removeExpireNodes 的调用次数
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务