且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

备用FizzBu​​zz问题

更新时间:2023-02-10 18:49:39

我已经看到一小部分相对简单的编程问题,这些问题用于淘汰候选人,就像FizzBu​​zz一样.以下是我见过的一些问题,按照难度增加的顺序排列:

I've seen a small list of relatively simple programming problems used to weed out candidates, just like FizzBuzz. Here are some of the problems I've seen, in order of increasing difficulty:

  1. 反转字符串
  2. 颠倒一句话(鲍勃喜欢狗"->狗喜欢鲍勃")
  3. 在列表中找到最小值
  4. 在列表中找到最大值
  5. 计算余数(给出分子和分母)
  6. 从包含重复项的列表中返回不同的值(即"1 3 5 3 7 3 1 1 5"->"1 3 5 7")
  7. 返回不同的值及其计数(即上面的列表变为"1(3)3(3)5(2)7(1)")
  8. 给出一串表达式(仅变量,+和-)和一组变量/值对(即a = 1,b = 7,c = 3,d = 14)返回表达式的结果( "a + b + c -d"应为-3).

这些是针对Java的,您可以使用标准库,因此其中的一些库非常简单(例如6).但是它们像FizzBu​​zz一样工作.如果您对编程有所了解,那么您应该可以很快完成.即使您不太了解该语言,您也应该至少能够在做某事的背后给出想法.

These were for Java, and you could use the standard libraries so some of them can be extremely easy (like 6). But they work like FizzBuzz. If you have a clue about programming you should be able to do most pretty quickly. Even if you don't know the language well you should at least be able to give the idea behind how to do something.

使用此测试,我以前的一位老板看到了所有内容,从快速完成所有任务的人,到可以很快完成全部操作的人,再到一个半小时后无法回答一个人的人.

Using this test one of my previous bosses saw everything from people who aced it all pretty quick, to people who could do most pretty quick, to one guy who couldn't answer a single one after a half hour.

我还应该注意:他让人们在执行这些任务时使用他的计算机.明确指示他们可以使用Google等.

I should also note: he let people use his computer while they were given these tasks. They were specifically instructed that they could use Google and the like.