昨天面试题选~续9.How would you implement a hashtable?How do you deal with collision?10.Draw a TCP client_server interaction diagram specify what socket function call that involved in constructiong the client and server.c++: 1.when are copy constructors called?2.How do you know that your class need a virtual destructor?Java: 1.what are different between in application/applet/servlet?Http: 1.http:/johnb:[email protected]/ what does the johnb:y2ktoday portion of the URL represent?2.A url look like this: https/www.xxx.com/ what port on the web server will be contacted?3.What is difference between HTTP1.0 and HTTP1.1?CGI: 1.Which environment variables need to be inspected in order to retrieve the date sent to a sever via the GET or POST methods2.Is it possible for the user to change the value in hidden form variable?3.What security flaws can be introduced if the user's input is passed to a CGI program unchecked?4.Write a sample request and response message for retrieving the HTML page.........over 面试是一家硅谷公司在上海的分部 职位是web developer
int rotato(unsigned int m, unsigned int n) { n &= (sizeof(int)*8-1); int shifted = m& ((1<<n)-1); return (shifted << (sizeof(int)*8-n)) | (m>>n); } void swap(int& x, int& y) { x^=y; y^=x; x^=y; }
#define with ";" is valid. And in his code, it does not cause any problem.
fread应该是
fread(str,sizeof(char),100,fd)
fwrite类似
1.when are copy constructors called?2.How do you know that your class need a virtual destructor?Java:
1.what are different between in application/applet/servlet?Http:
1.http:/johnb:[email protected]/ what does the johnb:y2ktoday portion of the URL represent?2.A url look like this: https/www.xxx.com/ what port on the web server will be contacted?3.What is difference between HTTP1.0 and HTTP1.1?CGI:
1.Which environment variables need to be inspected in order to retrieve the date sent to a sever via the GET or POST methods2.Is it possible for the user to change the value in hidden form variable?3.What security flaws can be introduced if the user's input is passed to a CGI program unchecked?4.Write a sample request and response message for retrieving the HTML page.........over
面试是一家硅谷公司在上海的分部
职位是web developer
{
n &= (sizeof(int)*8-1);
int shifted = m& ((1<<n)-1);
return (shifted << (sizeof(int)*8-n)) | (m>>n);
}
void swap(int& x, int& y)
{
x^=y;
y^=x;
x^=y;
}
应该改成:#define Error(str) printf("Error: %s\n",str); \
exit(1);分号在这几段代码里面是无所谓的。2:0_CREAT,0_RDWR这些都是宏, 必须包含额外的头文件。
C89里面有“隐含的int规则”这种说法, 见"C语言大全(第四版),电子工业出版社" 111页, 所以不规定main()的返回类型也是可以的。但是C99里面不再允许。