注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
昨天刚面完indeed karat电面,今天就收到了VO的通知
基础知识:
我选了system internal && OOD,贴出我自己总结的答案,有些是参考地里的:
System internal:
1, what is difference between Thread and Process
Process means a program is in execution, whereas thread means a segment of a process.
A Process is not Lightweight, whereas Threads are Lightweight.
A Process takes more time to terminate, and the thread takes less time to terminate.
Process takes more time for creation, whereas Thread takes less time for creation.
Process likely takes more time for context switching whereas as Threads takes less time for context switching.
A Process is mostly isolated, whereas Threads share memory.
Process does not share data, and Threads share data with each other.
2, How to communication between thread and processes
Process use shared memory, pipe and message queuing for the communications.
Threads of the same process can communicate with each other through synchronization primitives like locks and semaphores, events like wait and notify, or through shared memory.
3,What is difference between heap and stack
The major difference between Stack memory and heap memory is that the stack is used to store the order of method execution and local variables while the heap memory stores the objects and it uses dynamic memory allocation and deallocation.
Stack is a linear data structure whereas Heap is a hierarchical data structure.
Stack memory will never become fragmented whereas Heap memory can become fragmented as blocks of memory are first allocated and then freed.
Staource_5': {'resource_4': 1.0},
'resource_6': {'__END__': 0.5, 'resource_5': 0.5}
}
For example, of 8 total users, 4 users have resource_3 as a first visit (user_1, user_2, user_3, user_5), 2 users have resource_1 as a first visit (user_6, user_22), 1 user has resource_2 as a first visit (user_7), and 1 user has resource_6 (user_8) so the possible next steps for __START__ are resource_3 with probability 4/8, resource_1 with probability 2/8, and resource_2 and resource_6 with probability 1/8.
These are the resource paths per user for the first logs example, ordered by access time:
{
'user_1': ['resource_3':{'resource_3'}, 'resource_3':{'resource_1'}, 'resource_1':{}],
'user_2': ['resource_3', 'resource_2'],
'user_3': ['resource_3'],
'user_5': ['resource_3'],
'user_6': ['resource_1', 'resource_6', 'resource_5', 'resource_4'],
'user_7': ['resource_2'],
'user_8': ['resource_6'],
'user_22': ['resource_1'],
}
求加米!!!!
|