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

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
}
``````

``````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,
``````

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

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转成一样的单位

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项，草稿纸上推算了一下。

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