חלקPart 6: Python בעידן ה-AI וקריירהPython in the AI era & career
כ-3 שעות (כולל הפסקה)About 3 hours (with a break)
הכנה לראיון עבודהJob interview prep
שאלות נפוצות, קוד על הלוח, פרויקטים בקורות חיים.
Common questions, whiteboard coding, projects on your CV.
הנקודות החשובותKey points
- שיחת היכרות → מבחן בית/אונליין → ראיון טכניIntro call → home/online test → technical interview
- מעריכים חשיבה, לא רק תשובהThey assess thinking, not just the answer
- "כמה פעמים", "הכי נפוץ", "יחיד""How many times", "most common", "unique"
Counterאוdict.get(x, 0) + 1Counterordict.get(x, 0) + 1- מהקצוות פנימה: פלינדרום, סכום בזוגFrom the ends inward: palindrome, pair sum
- ברשימה ממוינתIn a sorted list
- "רצף של k", "הכי ארוך בלי...""A run of k", "longest without..."
- מוסיפים את הנכנס, מחסירים את היוצאAdd what enters, subtract what leaves
- להגיד את התוכנית לפני הקודSay the plan before the code
מונחיםTerms
- ראיון טכניtechnical interview: שלב בגיוס שבו פותרים בעיות קוד מול מראיין ומסבירים את החשיבה.A hiring stage where you solve coding problems in front of an interviewer and explain your thinking.
- דפוס פתרוןsolution pattern: רעיון שחוזר בהרבה שאלות, כמו "לספור במילון" או "שני מצביעים". זיהוי הדפוס הוא חצי מהפתרון.An idea recurring across many questions, like "count in a dict" or "two pointers". Spotting the pattern is half the solution.
- שני מצביעיםtwo pointers: שני אינדקסים שנעים ברשימה (מהקצוות פנימה, או אחד אחרי השני) במקום לולאה כפולה.Two indexes moving through a list (from the ends inward, or one after another) instead of a double loop.
- חלון נעsliding window: תת-רשימה ברוחב קבוע שזזה צעד אחרי צעד, ומעדכנים בה סכום במקום לחשב מחדש.A fixed-width sub-list sliding step by step, updating a sum instead of recomputing.
- שיטת STARSTAR method: מבנה לתשובה על ניסיון: Situation, Task, Action, Result.A structure for answering about experience: Situation, Task, Action, Result.
Cheatsheet
שלביםStages
STEPS = [
("Understand", "Repeat the question in your words. Ask about input size, empty input, duplicates."),
("Examples", "Work 2-3 small examples by hand, including an edge case."),
("Solve", "Say the plan first, then code. Simple and correct beats clever."),
("Check", "Walk through an example line by line. Mention complexity."),
]
for i, (name, tip) in enumerate(STEPS, 1):ספירהCounting
from collections import Counter
def is_anagram(a, b):
return Counter(a.replace(" ", "").lower()) == Counter(b.replace(" ", "").lower())
def first_unique(text):
counts = Counter(text)מצביעיםPointers
def is_palindrome(text):
s = [c.lower() for c in text if c.isalnum()]
i, j = 0, len(s) - 1
while i < j:
if s[i] != s[j]:
return False
i, j = i + 1, j - 1חלוןWindow
def best_week(pages, k=7):
window = sum(pages[:k])
best, best_start = window, 0
for i in range(k, len(pages)):
window += pages[i] - pages[i - k]
if window > best:
best, best_start = window, i - k + 1לחשוב בקולOut loud
def fizzbuzz(n):
out = []
for i in range(1, n + 1):
if i % 15 == 0:
out.append("FizzBuzz")
elif i % 3 == 0:
out.append("Fizz")הצגהPitch
PITCH = [
("Problem", 20, "I kept losing track of what I read and how far I got."),
("What I built", 40, "Shelf: a Python CLI and API. Book dataclass, JSON then SQLite, argparse, FastAPI."),
("Demo", 60, "shelf add, shelf read, shelf stats, and the monthly chart."),
("Challenge", 40, "Saving safely: I write to a temp file and swap, so a crash never corrupts data."),
("Next", 20, "Recommendations from a language model, verified by tests."),
]שגיאות שפגשנוErrors we met
| שגיאהError | מה זה אומרWhat it means | מה עושיםWhat to do |
|---|---|---|
AssertionError | קופצים לקוד לפני שמבינים את השאלה.Jumping into code before understanding the question. | AssertionError: did you ask whether duplicates count? ...: שאלה אחת ("מה עם כפילויות?") הייתה חוסכת את הטעות. sorted(set(nums))[-2].AssertionError: did you ask whether duplicates count? ...: one question ("what about duplicates?") would have prevented it. sorted(set(nums))[-2]. |
AssertionError | סופרים עם list.count בתוך לולאה.Counting with list.count inside a loop. | AssertionError: count סורק את כל הרשימה בכל פעם, וזה O(n²). Counter(words) עושה את זה במעבר אחד.AssertionError: count scans the whole list every time, which is O(n²). Counter(words) does it in one pass. |
AssertionError | שוכחים להזיז מצביע ונתקעים בלולאה.Forgetting to move a pointer and getting stuck in the loop. | AssertionError: stuck: neither pointer moved when the sum was too small: בכל מסלול בלולאה חייב להשתנות משהו. חסר else: i += 1.AssertionError: stuck: neither pointer moved when the sum was too small: every path through the loop must change something. It's missing else: i += 1. |
AssertionError | טעות באחד בגבולות החלון.An off-by-one at the window's edges. | AssertionError: 3 windows: ...: יש n - k + 1 חלונות. בודקים תמיד את החלון הראשון והאחרון ביד.AssertionError: 3 windows: ...: there are n - k + 1 windows. Always check the first and last window by hand. |
AssertionError | בודקים רק את הדוגמה מהשאלה.Checking only the example from the question. | AssertionError: 15 gives 'Fizz': ...: הדוגמה מהשאלה עברה, אבל מקרה הקצה (מתחלק בשניהם) לא נבדק. תמיד מנסים גם מקרה קצה.AssertionError: 15 gives 'Fizz': ...: the question's example passed, but the edge case (divisible by both) wasn't tried. Always try an edge case too. |
AssertionError | הצגה שמתחילה בפרטים טכניים ונגמרת לפני שמגיעים לעיקר.A pitch that starts with technical details and runs out of time before the point. | AssertionError: the pitch opens with 'Setup and venv' ...: מתחילים מהבעיה ומההדגמה. פרטים טכניים רק אם שואלים.AssertionError: the pitch opens with 'Setup and venv' ...: start with the problem and the demo. Technical details only if asked. |