- 论坛徽章:
- 0
|
这是一家什么样的公司?
http://www.sellingsource.com/
其实这道题来自全球500强的selling source公司
不晓得是出题太难,还是应聘者太糟糕。也许两者都有
上个星期我面试,只给了我一道题,要求1个小时内完成。很遗憾,我没能通过。放在这里和大家分享一下,其实我真的希望看到正确的实现办法,大家一起来讨论一下吧:
这是一道关于银行借贷的应用题,要求用PHP实现,乍一看,简单!结果越看越迷糊。
描述:创建一个类,用来计算还款的 due date
出题者预定义了这个类的结构和几个参数:
class Paydate_Calculator
{ /** This function determines the first available due date following the funding of a
loan.
* The paydate will be at least 10 days in the future from the $fund_day. The
* due_date will fall on a day that is a paydate based on their paydate model
* specified by '$pay_span' unless the date must be adjusted forward to miss a
* weekend or backward to miss a holiday
* Holiday adjustment takes precedence over Weekend.
*
* @param unix_timestamp $fund_day The day the loan was funded.
* @param array $holiday_array An array of unix timestamp's containing
* holidays.
* @param string $pay_span A string representing the frequency at which the
* customer is paid. (weekly,bi-weekly,monthly)
* @param unix_timestamp $pay_day A timestamp containing one of the
* customers paydays
* @param bool $direct_deposit A boolean determining whether or not the
* customer receives their paycheck via direct deposit.
* @return unix_timestamp A unix timestamp representing the determined due
* date.
*/
public function Calculate_Due_Date($fund_day, $holiday_array, $pay_span,
$pay_day, $direct_deposit)
{
return 0;
}
}
这个题大致是这个意思 :
due date 的意思是“最后期限”,通俗点就是,你1月1日借了500块,我规定:1月20号是你还钱的最后的日期
$fund_day 这个变量就代表:你借款的日期
$holiday_array 这个一个出题者定义的节假日数组,里面应该包含美国所有的节假日,比如国庆之类的。当然了。这个不是这道题的考试重点,随便定义几个问题不大。
$pay_span 这边变量定了用户的还款频率: 比如,是一个星期还一次?还是一个月还一次?
$pay_date 这个变量代表还款日期。它和due_date的区别在于,还款日期代表你已经可以开始还钱了,但这不是你的最后期限!
$direct_deposit 代表一个布尔型变量,在现实中代表,还钱的方法,是直接使用PAYCHECK还钱,还是通过其他途径?
下面是流程图:
[ 本帖最后由 kkboy_dyc 于 2008-9-12 08:34 编辑 ] |
|