r*8
2 楼
networking背景。和web公司的风格不大一样。多个公司的面筋。希望对后来人,有帮
助。
implement a hash table
lru cache
two sum
void store(int val);
store the value
bool test(int target);
return true if two stored values who sum equals target
otherwise false
We want test really fast.
O(1) test
O(n) store
Given a binary tree where parent node value is minimum of two children node
values, find the second min.
given nested list, return sum. Sum is defined as depth*current sum
what is dead lock? how to prevent it?
implement a readlock
implement a read write lock
how to create a c++ class preventing child from inheriting it?
reverse a stack without using extra memory
given a array, find the maximum continuous subarray sum
given a list of list
[1,[2,3],[4,5,[5,6]],0]
there could be multiple nesting
implement a next() api to find the next element.
given a file of words and a word
find all anagrams of the given word in the file
what is singleton
design the twitter backend. there are many tweets within the past 24 hours,
how to find the top 5.
Do you use java? Do you know java swing?
Design a timer lib.
printf(“%s”,NULL);
not crash
printf(“%sn”,NULL);
crash
why?
class C {
public:
void func() { printf(“non-virtual functionn”);}
virtual void vfunc() { printf(“virtual functionn”); }
};
C *obj=NULL;
obj->func(); ⇒ this does not crash. C::
obj->vfunc(); ⇒ this crashes, two memory accesses.
why?
difference between virtual function and non-virtual function
int get() {
static int d=1;
return d++;
}
printf(“%d %d %d”,get(),get(),get());
output?
Little endianness and big endianness
Byte padding in struct
Memory layout of argc, argv of main function
printf is a variable number of arguments function
gdb –g option,
How to design an general interface with different function implementations
using c?
Similar to base class and derived class.
Use function pointer to implement it.
助。
implement a hash table
lru cache
two sum
void store(int val);
store the value
bool test(int target);
return true if two stored values who sum equals target
otherwise false
We want test really fast.
O(1) test
O(n) store
Given a binary tree where parent node value is minimum of two children node
values, find the second min.
given nested list, return sum. Sum is defined as depth*current sum
what is dead lock? how to prevent it?
implement a readlock
implement a read write lock
how to create a c++ class preventing child from inheriting it?
reverse a stack without using extra memory
given a array, find the maximum continuous subarray sum
given a list of list
[1,[2,3],[4,5,[5,6]],0]
there could be multiple nesting
implement a next() api to find the next element.
given a file of words and a word
find all anagrams of the given word in the file
what is singleton
design the twitter backend. there are many tweets within the past 24 hours,
how to find the top 5.
Do you use java? Do you know java swing?
Design a timer lib.
printf(“%s”,NULL);
not crash
printf(“%sn”,NULL);
crash
why?
class C {
public:
void func() { printf(“non-virtual functionn”);}
virtual void vfunc() { printf(“virtual functionn”); }
};
C *obj=NULL;
obj->func(); ⇒ this does not crash. C::
obj->vfunc(); ⇒ this crashes, two memory accesses.
why?
difference between virtual function and non-virtual function
int get() {
static int d=1;
return d++;
}
printf(“%d %d %d”,get(),get(),get());
output?
Little endianness and big endianness
Byte padding in struct
Memory layout of argc, argv of main function
printf is a variable number of arguments function
gdb –g option,
How to design an general interface with different function implementations
using c?
Similar to base class and derived class.
Use function pointer to implement it.
x*u
3 楼
没事,都抢不到。。
r*8
4 楼
heck if a tree has a cycle
duplicate a graph
char *p;
p=*p=0;
what’s wrong with this code?
char *p;
p=*p=0;
what’s wrong with this code?
using uninitialized pointer
who will generate segmentation fault?
hardware, CPU.
how is segmentation fault generated?
CPU generates an unrecoverable fault, a kind of exception
why the lower address space is not used by neither os nor process?
avoid damage caused by uninitialized pointer
uninitialized pointer often contains garbage value which is small. That is
it points to lower address space. When we use it, it will not cause big
damage, since the lower address space is not used by anyone.
what is page size?
4KB
how to include header file using gcc
use –I directory
level print bt
from bottom to top
rotate matrix by 90 degree
given a large file containing strings, find the most frequent string
write code to determine endianness
what is big/little endianness
given two sorted arrays, find the intersect elements, and call a function
with input as the intersect element
what if one of the array is large and fixed?
2,3,4,5,6,7,8
store continuous number segment in balanced BST
print nth fib number
given a set of points on the line segment, and distance between two points,
find the minimum distance between two points x and y
o…………o…………………0………………0…………………o………………….o
dp problem
find the min and max of the array with less comparison, three instead of
four every two numbers
difference between process and thread
find the largest and second largest numbers
remove a character from the an input string
remove duplicate characters from an input string
check if a string has duplicate characters
byte alignment
struct my_struct{
double d1;
int d4;
char c[3];
int d2;
char h[0];
};
reverse a string
how is hashtable implemented
what is heap
what is stack (data structure)
what is stack (memory)
interprocess communication methods?
pipe, message queue, file, socket, shared memory, signal,
what is the software development flow?
duplicate a graph
char *p;
p=*p=0;
what’s wrong with this code?
char *p;
p=*p=0;
what’s wrong with this code?
using uninitialized pointer
who will generate segmentation fault?
hardware, CPU.
how is segmentation fault generated?
CPU generates an unrecoverable fault, a kind of exception
why the lower address space is not used by neither os nor process?
avoid damage caused by uninitialized pointer
uninitialized pointer often contains garbage value which is small. That is
it points to lower address space. When we use it, it will not cause big
damage, since the lower address space is not used by anyone.
what is page size?
4KB
how to include header file using gcc
use –I directory
level print bt
from bottom to top
rotate matrix by 90 degree
given a large file containing strings, find the most frequent string
write code to determine endianness
what is big/little endianness
given two sorted arrays, find the intersect elements, and call a function
with input as the intersect element
what if one of the array is large and fixed?
2,3,4,5,6,7,8
store continuous number segment in balanced BST
print nth fib number
given a set of points on the line segment, and distance between two points,
find the minimum distance between two points x and y
o…………o…………………0………………0…………………o………………….o
dp problem
find the min and max of the array with less comparison, three instead of
four every two numbers
difference between process and thread
find the largest and second largest numbers
remove a character from the an input string
remove duplicate characters from an input string
check if a string has duplicate characters
byte alignment
struct my_struct{
double d1;
int d4;
char c[3];
int d2;
char h[0];
};
reverse a string
how is hashtable implemented
what is heap
what is stack (data structure)
what is stack (memory)
interprocess communication methods?
pipe, message queue, file, socket, shared memory, signal,
what is the software development flow?
a*0
5 楼
就当今天休息了,呵呵
相关阅读
snap是5年前的facebook还是三年前的twtr?感觉烙印团结是有原因的求内推unidentified_title最近天气转凉,周末大家有啥计划?看到招聘网站说的大部分员工的工资在潜水的大牛们应该比地里的年长至少十岁吧?紧急求助 H1B 60 Days Grace Period 三周到期,怎么办?刷题算什么,人家婊子可是刷脑力+体力啥是PXJ?老是甲骨文LAYOFF,为什么狗,脸不大量LAYOFF人 (转载)一家据说马上就要IPO的公司给了个offer, 说是给3w股 stock opt各位觉得:算法高薪马公与奥赛银牌或考清北比哪个难提供google内推大家好!我是飞象!这个版上用卡通人物头像的都很好尼玛北美所难马公们有几个能搞出3000万用户的app (转载)幸好先刷题拿了40万大包大部分CS毕业都是找software developer的工作吗?Speech+NLP跳槽去robinhood咋样