找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1624|回复: 4
收起左侧

[Startup公司] InfoScott take home test

[复制链接]

35

主题

2

精华

368

积分

高级会员

Rank: 3Rank: 3

积分
368
发表于 10-5-2015 01:06 AM | 显示全部楼层 |阅读模式

亲!马上注册或者登录会查看更多内容!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
1)
Imagine you are creating an application that has a 25 step tutorial. These tutorial steps can be completed in any order. Furthermore the steps are grouped into 5 groups:
4 j& n' G# j2 t( E4 W
Group 1: Steps 1--5
Group 2: Steps 6--10
Group 3: Steps 11--15
Group 4: Steps 16--20
Group 5: Steps 21--25
% v5 I, G. [5 E9 c( @7 c
A group is considered finished if all of the steps in that group are finished.

" Q# X# i  A! Y5 X" B/ {- _
Create a Tutorial class that implements the following (the function definitions are written here in a c-based style, but you can implement in any language of your choosing):

6 n; P& L( R7 a1 R. m* _0 J" V5 o
boolean isStepComplete(uint stepNum); //Checks whether a single step number is complete.
boolean isGroupComplete(uint groupNum); //Checks whether a group is complete.
void setStepComplete(uint stepNum); //Sets the given step to complete.
boolean isTutorialComplete(); //Checks whether all steps are complete.

7 V* N% Y  u1 e% Q: ]9 S
The goal is to make this class as efficient as possible both in memory use and runtime.

! O# A" y3 _) j) P3 u/ s: ^+ J
2)
Imagine we want to design a program to run the inventory for a shop that sells bagels and coffee. For simplicity, the only requirement is that there is a public API to purchase items which takes a list of items you want to buy (i.e. 2 coffees and a bagel), updates the inventory of our store, and returns the price for all of the items. However, our store is a little bit shady and they change the prices based on certain factors:

+ L( ]0 ^$ F9 y& g7 Q* H
Coffee:
$2 base price
+$1 between 6am and 10am local time
Unlimited supply (never needs to be restocked)
: x( V3 X1 n: t1 R: l! O1 P0 Q- _
Bagel:
$2 base price
+$1 if we have less than 10 in stock
For simplicity, every run of the application we start with a supply of 15 bagels. Once we run out there are no more until the application is completely restarted.
6 T0 z- \5 J$ B: S
Think of this as a base design that we will expand upon in the future so the goal here is to design the code to be easily extensible. You are free to use any language you’d like and design the code in any way you see fit so that the above conditions are met.

7 Z, x+ B, q3 `9 D" e$ \  z: a) E, O, D$ ]* E

& C1 c1 I/ P6 {1 Z5 Z

评分

参与人数 1金钱 +6 收起 理由
Sophia + 6 赞一个!

查看全部评分

781

主题

575

精华

5670

积分

顶级版主

Rank: 9Rank: 9Rank: 9

积分
5670

活跃会员热心会员优秀版主

发表于 10-5-2015 09:58 PM | 显示全部楼层
感谢您的面经分享~~~精华积分满满送上~~~
我们始终相信IT会持续改造甚至创新传统行业,我们始终全面看好咱们的CS专业!

50

主题

1

精华

303

积分

高级会员

Rank: 3Rank: 3

积分
303
发表于 10-6-2015 12:37 AM | 显示全部楼层
这什么公司啊?求个link?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表