mathworks电面面经+地里电面总结和基础题答案

刚刚面完。。。考了两个coding,和一个ood,问了一些简历。并没有像之前说的会考基础概念和数学,CPP从头到尾,也没有用第二种语言。所以面试提前结束了。1. 利口 耳凌溜。 因为我之前 oa的时候发邮件说他们题目有问题(题目有 bug),考完被面试官问为什么觉得有问题。
2. 利口 溜酒漆。
ood 是parking lot.
我把我复习准备的资料贴在了下面,这里也感谢以下提供面经的各位小伙伴们。(导致帖子很长,但是同学们就不需要自己的下载啦!)。就不设限制啦,毕竟我也不多,非常懂没米的心酸。

//以下是我准备的资料****************

    Restaurant reservation online answerint CheckTableAvailability(int NumPeople, time_t TimeOfbooking, int *tableNumber, time_t *alternativeTime) 
    {
    if(isTable_Available(NumPeople,TimeOfBooking))
    {
    *tableNUmber=isTable_Available(NumPeople,TimeOfBooking);
    return 1;
    }
    if(alternate_time(NumPeople,TimeOfBooking))
    {
    alternatetime=alternate_time(NumPeople,TimeOfBooking)
    return 2;
    }
    else
    {
    cout<<"no Booking possible";
    return 0;
    }

    }Class: Table
    {
    int TableId;
    int SeatingCapacity;
    string speciality;
    }

    Class Booking
    {
    int bookingId;
    int TableId;
    time_t startTime;
    customerDetails;
    }

    Class: BookedTables
    {
    HashTable bookings ( key: timeslot, value: int booked[NumTables] );
    // int array will contain whether the table is booked or not for this time slot. A value of 0 means not booked. A value other than 0 represents a booking id
    }

My answer

enum week{
Mon, Tue, Wed, Thur, Fri, Sat, Sun
};
 Class Table{ 
       Int tableId;
       Int serveNum;
      enum tableType;        
      Bool isAvailable;
      vector<TimeInterval> vec;
};

Class Booking {        
Int bookingId;       
 Int tableId;       
 time_t startTime;  
time_t        
time_t espectedEnd;        
Time_t timeForLate;  
 };

Class customer {       
 Int customerId;        
String customerName;        
String contacts; //phone number
};

Parent class TableChild classesCustomer: id-> random()customer()setCustomerId()  ----getCustomerId()``````Num, timeTable->func(Num, time)BookingHashtable -> tableHashtable -> bookingBool hasAvailableTable(int serveNum) {}Void bookTable(String name, stirng contacts) {}Void releaseTable() {}cancelTable()checkInFunctionmonitorFunction: thread, 

整理的1年以内的面经以及概念题答案~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~先问对这个项目有没有了解接着写码 被三姐出了道hard 一紧张有点蒙圈 用了O(n) space 利特口的 饲狮衣问之前经历问了好久:自我介绍 -》详细介绍实习-》实习有没有用oop-》把用到的oop部分概括写出来. 一亩-三分-地,独家发布写一个网上订餐系统的oop问oop的好处是什么 为什么实习写的码需要用oop有什么问题结束……并没有问地里说的任何数学和编程概念,可能觉得码没写出来,懒得问了-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Java:class Sample {foo1()static foo2()}what’s the difference between them, when you call it from the outside;Sample sample1=new Sample();sample1.foo();Sample.foo2(); // static function is not related instance

https://stackoverflow.com/questions/2671496/java-when-to-use-static-methods Java Generics?

https://www.tutorialspoint.com/java/java_generics.htm

List ll = new LinkedList();. List ll = new LinkedList<>();印度小哥面的,还买了个破绽,一开始给我写反了String, StringBuffer, & StringBuilder difference?Mutability Difference:String is immutable, if you try to alter their values, another object gets created, whereas StringBuffer and StringBuilder are mutable so they can change their values.Thread-Safety Difference:The difference between StringBuffer and StringBuilder is that StringBuffer is thread-safe. So when the application needs to be run only in a single thread then it is better to use StringBuilder. StringBuilder is more efficient than StringBuffer.Situations:If your string is not going to change use a String class because a String object is immutable.If your string can change (example: lots of logic and operations in the construction of the string) and will only be accessed from a single thread, using a StringBuilder is good enough.If your string can change, and will be accessed from multiple threads, use a StringBufferbecause StringBuffer is synchronous so you have thread-safety.for more.
How to represent graph in a data structure?. Map<Node, List>How many edges in a directed graph with n nodes?DFS & BFSom: 1point3acres 3. OOD 的概念基本都在语言里面问了。 还问了一个Restaurant Reserve Problem,说的很是模糊,就是做一个饭店的点餐系统,可以make reservation 和 cancle reservation。~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~4. Math班里45 人, 15人选英语和德语,总共18个人选英语,5个人都没选,问几个人只选德语?32 bit signed int, max = ? how to represent it in digit?. from: 1po编程语言选2个考,语法的那种;数学部分一个题,就问了简单的选英语德语都选这种题;编程一个题;. 一亩-三分-地,独家发布多线程一个题;ooad一个题;os一个题;你有什么要问面试官的`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1.java部分还好吧,系统学过的基本都能handle住2.python部分我很惨,不过如果有系统学习过的或者写过medium sized项目的应该也能handle住。怎么修改“abc”. visit 1point3acres for more.dictionaty的access. 一亩-三分-地,独家发布slicing??(我不知道我理解对了没有)各种传递reference我也不知道python里是个什么样,比如:init(id):this.id = idid = 6663.os的一个题问的是两个programe还是process想访问同一个memory怎么办。4.ooad问的restrurant可惜我没搞明白她到底要expect什么,给设计了receipt然后说她要的是table。~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Matlab给定一个2D matrix,每一列的数据是用不同的单位的,毫米厘米米公里,然后写code转成一样的单位
我一开始是每一列操作一下 然后面试官说要一行搞定,写了个vectorize的版本
给定一段code有一个nested forloop,是对每一个元素进行一个比较和赋值,要求要改成一行code直接解决
C++Pointer为什么要有null
It is always a good practice to assign the pointer NULL to a pointer variable in case you do not have exact address to be assigned.怎么判断一个数是不是奇数% operator有啥用,有啥局限性
ONly used in Integers, not allowed for large integersc++ main程序怎么往里面传input,考argc argv
int main(int argc, char** argv) { std::cout << “Have " << argc << " arguments:” << std::endl; for (int i = 0; i < argc; ++i) { std::cout << argv << std::endl; } }linked list 和 array,为什么LL比array更适合insertion和deletionRight Side View of a tree,利口 要酒酒,之前写过,讲了思路, 瞬秒给了个等差数列,要求第200项,草稿纸上推算了一下。
考 system design,设计一个online food delivery system。~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1.public static void main(String[] args) 都是啥意思[br]2.给两个function, 一个是static一个是non-static, 怎么调用3.多态,看代码输出结果4.oop概念好处https://www.cs.drexel.edu/~introcs/Fa15/notes/06.1_OOP/Advantages.html?CurrentSlide=3 5.matlab 删除一行6.把一个矩阵的每一列进行变换7.如果define一个函数叫plot, matlab能运行吗8.继承多态概念9.design ATM10.O(nlogn) 的base是啥11.一个序列求第n个数是啥 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Java部分:问了== 和equals的区别?https://www.geeksforgeeks.org/difference-equals-method-java/

多态和继承,垃圾回收,还有如果A,B互相调用,可否eligible?用final和finalize一定可以保证回收么?https://www.geeksforgeeks.org/g-fact-24-finalfinally-and-finalize-in-java/java

是否有destructor?NoOOP和多态的概念,什么叫GraphOOD:饭店点餐系统 尽量不要写很多东西,直接大概写写一定要说清楚,三哥哥很不耐烦的样子算法部分:Sort的方法和算法复杂度https://en.wikipedia.org/wiki/Sorting_algorithm给大家一个小技巧,可以通过三哥哥的反应来判断你自己的回答是不是对的。如果你答错了,三哥哥会说“你确定是这样?”这就是提示大家赶紧改下答案,然后象征性的解释一下。。。因为三哥哥没啥耐心,我看基本上你答对了他会说好,那就进行下一个吧。。。总之lz感觉很不好,三哥哥在你问了第三次“Sorry”之后就很aggresive了。。。所以lz也变得非常aggressive,然后就坐等据信吧,感觉跪到不行。。。1. What is indefinite integral and definite integral? (Basic Calculus)2. Give a matrix A, what does A.’’ mean? (Matlab)3. How to plot 3 points using ‘’*’’ and colored in green? (Matlab)4. What is linear phase (Signal Processing)

https://www.geeksforgeeks.org/multiple-inheritance-in-c/

哇感谢楼主。我也刚电面完,昨天发邮件跟我说过了点面,然后在约跟一个manager的phone call。看你的描述你应该过没问题。有消息update一下哦。

请问下OOD的题需要写每一部分的实现代码吗?还只是框架?谢谢

恭喜楼主!