Techincial interview questions was not clear at begging or intent .. especially the template of the code.
Seems like company for people with closed loop, people stay for long time... kind of נמל !
שאלות מתוך הראיון
Given shapes, Circle, Rectangle and a Text Box.
Circle represented by (x,y) - center point and r, radius.
Rectangle represented by two points (x1,y1), (x2,y2) - the two far points.
Text box by a point (x,y) and a string
Need to write efficient serialization to save info, and desterilize it
This should be done with a given template code which has
class ShapesContainer {...}
And later some other function serialize and func desterilize ...
One last thing, how the code will survive if a new shape added that is not supported by code?
תשובות
הוסף תשובה
|
לצפיה בתשובות
יולי 2021
For the serialization part
[Shape_Type_1][Shape_info][Shape_Type_2][Shape_info]....
where is Shape_Type is 1B (gives up to 256 possible shapes).
And Shape_info is determined from shape type, meaning, to read a point and radius or two points or ...
To handle the problem that a new shape need to be desterilized, but not supported but this code version, need to improve above encoding/decoding to:
[Shape_Type_1][Info_Len][Shape_info][Shape_Type_2][Info_Len][Shape_info]....
That will give ability even if shape type no recognized to know its len and jump to the next shape (or end of file).
1. סקירה מה החברה עושה
2. לספר על פרויקט שעשית
3.שאלה שמתפתחת
שאלות מתוך הראיון
יש לוח ועליו צורות של עיגול, ריבוע, משולש ו - inputText.
בשמירה של האובייקטים לדיסק קשיח יש לתכנן את הקובץ שיכתב כך שיהיה קטן ככל האפשר.
יש גם לבצע קריאה של הקובץ ויצירת האובייקטים
נתון:
משולש מיוצג ע"י נקודה, X,Y ורדיוס R
ריבוע- נקודה, אורך ורוחב
תיבת טקסט- נקודה וטקסט
תשובות
הוסף תשובה
|
לצפיה בתשובות
פברואר 2020
נתון
נכתוב את הצורות
כל אויביקט יחזיר מחרוזת כזו:
CIRCLE,2,3,5\n
כלומר, מדפיס את המאפיינים שלו, שזה X=2, Y=3, R=5
תיבת טקסט -INPUTTEXT,4,5,XXXX\n
כאשר XXXX זה הטסטק שלה אך חשוב לקודד אותו!!! אפשר ב URLEncode
יש n\ בסוף המחרוזת...כך שכך אוייבקט ירשם בקובץ בשורה נפרדת.
חשוב שכולם ירשו מממשק.
בקריאה, כל שורה זה אוייקבט , לכן עושים ספליט על פסיק, את המערך שולחים לפקטורי כשאר, לפי השם שמופיע בתא 0 הוא מחזיר צורה מתאימה. כל צורה תקבל בקונסטרקטור שלה את שאר המערך והיא כבר תדע למפות את הדטה למאפיינים הנכונים
מאי 2020
לא הבנתי איך הפתרון הזה עונה על כך שהקובץ יהיה קטן ככל האפשר.. נשמע די בזבזני
Qwilt solves the online video problem for network operators with an open caching solution that increases network capacity and improves subscriber quality of experience