注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
这个公司第一轮电面找的第三方平台Karat面的 但题目应该是公司出的
题目是给你一个skeleton code和tests. 让你填function跑过test
基本就是有个高速收费系统,有好多个子问题让你加不同的功能。
例如计算每个车每个旅程的路费,每个车每段路程是否有超速 之类的 都是比较简单的数学题 主要看你写代码和交流能力感觉。
我看他家面经好像一共就两个题目,这是其中一个。但我是后来搜SD的时候才搜到的。可惜了,分享给大家,求加米
import static org.junit.Assert.assertEquals; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.*;
/* We are writing software to analyze logs for toll booths on a highway. This highway is a divided highway with limited access; the only way on to or off of the highway is through a toll booth.
There are three types of toll booths:
ENTRY (E in the diagram) toll booths, where a caexample, the following excerpt of log lines contains complete journeys for the cars with JOX304 and THX138:
. . . 90750.191 JOX304 250E ENTRY 91081.684 JOX304 260E MAINROAD 91082.101 THX138 110E ENTRY 91483.251 JOX304 270E MAINROAD 91873.920 THX138 120E MAINROAD 91874.493 JOX304 280E EXIT . . 91982.102 THX138 290E EXIT 92301.302 THX138 300E ENTRY 92371.302 THX138 310E EXIT |