בחדר סגור יש 3 מנורות. אתה עומד מחוץ לחדר ויש 3 מתגים. מותר לך להכנס לחדר פעם אחת ולפי זה תצטרך לגלות איזה נורה שייכת לאיזה מתג.
תשובות
הוסף תשובה
|
לצפיה בתשובות
ינואר 2023
מדליק מנורה אחת למשך זמן ארוך מאוד לאחר מהם מחליף לנורה אחרת ואז נכנס לחדר
הנורה שתהיה חמה זו הראשונה שהדלקתי הדולקת תהיה המתג השני והנותרת תהיה השלישית
שני ראיונות מקצועיים בתהליך מעבר בתוך החברה. בראשון אמרו שתהיינה שאלות אלגוריתמיות בפסאודו קוד ומערכות ספרתיות, בשני אמרו לי שתהיה שאלת מחשבה.
שאלות מתוך הראיון
First interview question:
Given a binary matrix of size M*N randomly populated with 1's and 0's, for every '1' fill its row and column with 1's. Solve in space complexity of O(1). Time complexity is not important.
Second interview question:
Given the following assembly commands:
MOV Ri <-- Rj/immediate (put register j or immediate value into reg i)
INC Ri (++)
DEC Ri (--)
JNZ Ri (jump not zero)
1. Code an assembly program that calculates x*y where x and y are unsigned integers
2. What values of x and y will cause the program to fail?
3. Modify the program to deal with these values
4. What result will we get if we run the program with values from question 2 and no modification from question 3?
5. Is it possible to answer question 1 without MOV command? Prove it!
תשובות
הוסף תשובה
|
לצפיה בתשובות
נובמבר 2022
Hints for the first question:
Try at first an O(M+N) solution, then O(M), then O(1) by using the original matrix and one extra bit.
Hints for the second question:
1. Adding 1 in a nested loop
2. 0 was my wrong guess, there are actually none
3. Jump over the calculation if x or y are 0
4. 0
5. Yes. Create MOV from the other commands.
אינטל הוא תאגיד בינלאומי אמריקאי, אשר ידוע בעיקר כמתכנן ויצרן של מיקרו־מעבדים (החל משנת 1971) ומתמחה במעגלים משולבים. כמו כן, אינטל מייצרת כרטיסי רשת, מערכות שבבים ללוחות אם, והתקנים אחרים.