What types of caches you have and when you will use them
תשובות
הוסף תשובה
|
לצפיה בתשובות
ינואר 2019
1.
|LRU- last recent used cache where I handle the items – which item I need to remove if I reach the end of the cache capacity (look question 4).
this cahce is limited by size and not by memory
2. look at weak reference caches (weak reference hash map of weak reference wrappers) also at phantom reference.
If I use with weak reference cache the size of the cache is not limited but when the JVM need to space it remove items from the map (if no other reference is pointing on it).
This cache is limited my memory and handles by the JVM.
שאלות מהראיון הראשון (ראיון עם ראש הserver):
צריך להסביר על פרויקט גדול שעבדת עליו בעבר ומבקשים לצייר את המחלקות העיקריות והקשרים בינהם ואז שואלים על המימוש והטכנולוגיות.
שאלות טכניות:
1.מימוש והסבר design pattern לבחירה (שאינו סינגלטון) ואם יודעים Facade או factory אז בכלל טוב.
2.האם יכולים להיות שני אובייקטים עם אותו ערך hash code?
3.זמן ריצה של חיפוש איבר במערך, זמן ריצה של חיפוש איבר בhashmap.
4.שאלת קוד בjava שמכיל תור עדיפויות וקומפרטור. שואלים מה יודפס לאחר הכנסה בשורה אחת של מספר איברים (q.addAll) ואז ההדפסה של q.poll.
5.שאלת קוד בjava שמכיל 2 טרדים. אחד מכניס לarraylist איברים בלולאה עד 10 והשני מדפיס את האיברים באותו arraylist בעזרת iterator. השאלה היא איזה שגיאות ריצה יש ואיך הייתם מתקנים.