Skip to content

Instantly share code, notes, and snippets.

@zhugw
zhugw / gist:c96cff5e9cbad850bbf5f5f8ae7a5397
Last active June 5, 2023 09:56
博晓通Java实习生笔试题
## 说明
基于实际工作场景出的题目 后面日常工作很有可能就是这类开发
## 笔试题
### 数据处理工作
博晓通是一家数据分析公司 会有很多数据处理的场景
#### 打标签
说明
对采集的啤酒电商数据 打上系列标签 规则为
/**
* Created by zhuguowei on 2020/12/2.
*/
public class FooTest {
public void display1(int a, int b, int c) {
String val1 = getAValue(a);
String val2 = getBValue(b);
@zhugw
zhugw / gist:9ee818c464010f9eb7d2fcd947bbeb46
Created August 21, 2017 07:28
Html ajax request and show result in table
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<title>Title</title>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<style>
table{
text-align: center;
@zhugw
zhugw / gist:8d5999a3b2f6aef3ca21f53ca82d054c
Created August 19, 2017 03:11
Java invoke python script
# Java invoke Python script
## Python script
```
python test.py
hello world
# with parameter
python test.py foo bar
hello world
['foo', 'bar']
package interview;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.RecursiveAction;
/**
* 两个人轮流取苹果 每次只能取1/2/3 谁拿了最后一个谁就获胜
package interview;
import org.apache.commons.lang3.RandomUtils;
import java.util.ArrayList;
import java.util.List;
import static java.util.stream.Collectors.toList;
/**
/**
* 面试题:
* *表示0或多个字符 判断一个字符串是否匹配模板
* 如 字符串"abc"匹配"a*c" 字符串"abc"不匹配"a*d"
* Created by zhuguowei on 5/18/17.
*/
public boolean match(final String s, final String pattern) {
if (s == null || pattern == null) {
throw new IllegalArgumentException("params cannot be null");
}
package interview;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.RecursiveTask;
/**
* Created by zhuguowei on 5/17/17.
*/
public class ForkJoinPow extends RecursiveTask<Long> {
private int a;
package interview;
import org.junit.Test;
import java.util.concurrent.ConcurrentHashMap;
import static org.junit.Assert.assertEquals;
/**
* efficiently implement a^b
@zhugw
zhugw / gist:b5beb900ac101066c73e867e6dc9d9b2
Last active May 16, 2017 09:43
The effect of an object with or without euqals and hashCode as a hashmap key
package interview;
import org.junit.Test;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;