logo

Zho の面接体験 |セット 22 (経験者)

ユーザー定義関数のみ。組み込み関数はまったくありません。 
vars に直接割り当てられる入力のスキャンは行われません。 

レベル 1: (2 時間 - ペンと紙) 
1.与えられた値を使用して方程式 X 乗 Y を解きます。 

Example: Input: X=2 Y=-2 Output: 0.25



2.指定された 2 点間の距離を求め、最も近い数値に丸めます。

Example: Input: (24)(410) Output: 6



3.「$」をエスケープシーケンスとして扱い、指定された文字列内の文字数をカウントします。 「$」の前に「」がある場合は、エスケープ シーケンスではなく、通常の「$」と見なされます。 '' が発生した場合は、単一の '' として扱います。



Example: Input: Hello$World$ Output: 11



4. 2D 行列が与えられた場合、すべての要素の合計を求めます。

Example: Input: [1 2 3] [4 5 6] [7 8 9] Output: 45




レベル 2: 
1 つの質問を完了すると、次のタイプが表示されます。合計5問。 (3時間 - マシンラウンド) 
1.指定された X Y Z の値を使用して方程式 (XpowerY/Z!) + (Z/(X!+Z)) を解きます。X と Z を負にすることはできません。

Example: Input: X=2 Y=3 Z=4 Output: 1


2.バットマン スパイダーマンとスーパーマンはビジネスを始めようとしています。総投資額は10億ドル。誰でも既存の投資に新しい投資を追加できます。彼らは自分自身の間で投資を移転することができます。プログラムは OOP スタイルである必要があり、ユーザーがすべての操作を実行できるメニューが必要です。 (以下の例のようなものです。) 

Constraints: a.Total investment should always be equal to or lesser than 1000M$. b.Spiderman's investment should never exceed Batman's. c.Investment cannot go into negative. d.Display investments on each update. Example: Input: batman = 300 spiderman = 250 superman = 100 Output: batman - 300 spiderman - 250 superman - 100 add 100 into spiderman sorry spiderman cant have more investment than batman add 200 to batman batman - 500 spiderman - 250 superman - 100 add 500 to superman sorry total investment cant exceed 1000. 



3問目は時間切れで解けませんでした。次のラウンドに進むには、3 つの質問に回答する必要があります。 

関連する練習問題 2点間の距離 行列内の要素の合計


 

クイズの作成