由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 发个电话面经
相关主题
一个C语言概念题Bloomberg电面面经
1st Amazon phone interview (1hr)C++面试问题,供参考
C++ Q42: (C22)offer比较 求建议
再问C++a C question about global variable
C++ Q29: extern and const together【Job Opening】南加金融公司招软件开发 (转载)
请教一个const和non const的C++问题求内推[金融公司或者IT公司]
问个C/C++概念的问题在高盛当码农是什么个感觉?
C++问题3内推纽约金融公司程序员
相关话题的讨论汇总
话题: mutable话题: compiler话题: const话题: extern话题: variable
进入JobHunting版参与讨论
1 (共1页)
S******n
发帖数: 132
1
第一个电话面试,答得不好
C++的几道题
1. why mutable, when should we use mutable?
我就按定义说了,想在const成员函数里面改变member variable,就需要mutable
然后他说你既然把函数定义成了const,就不应该去改变member variable,然后问我什
么情况下需要mutable,这样说来我就真不知道了,谁来解答一下
2. order of construction for member variables.
3. extern 用法: extern int c = 0; 合法吗?什么情况下需要用extern,有什么优
劣性
4. static用法
5. volatile用法,什么情况下使用,举例
这个我也答得不好,因为没用过,就记得概念,实际应用就不知道了
6. Fibonacci函数,要compile-time得到结果
template metaprogramming这个东西金融公司里面用得多吗?
template平时工作中用的多吗?如果真的挺重要,我还得努力补习一下
7. deque vs vector
好像就这些,想起来再补上
s******n
发帖数: 3946
2
学习了,mutable确实很搞,这个帖子说的还算清楚吗?
http://www.highprogrammer.com/alan/rants/mutable.html
就是说逻辑上函数是const的,但是实现上必须修改内变量。
啥金融公司C++扣得那么细
S*******w
发帖数: 24236
3
他们就是搞c++ 其它他们不在乎

【在 s******n 的大作中提到】
: 学习了,mutable确实很搞,这个帖子说的还算清楚吗?
: http://www.highprogrammer.com/alan/rants/mutable.html
: 就是说逻辑上函数是const的,但是实现上必须修改内变量。
: 啥金融公司C++扣得那么细

l*****a
发帖数: 14598
4
对于const variable 也可以用mutable

【在 S******n 的大作中提到】
: 第一个电话面试,答得不好
: C++的几道题
: 1. why mutable, when should we use mutable?
: 我就按定义说了,想在const成员函数里面改变member variable,就需要mutable
: 然后他说你既然把函数定义成了const,就不应该去改变member variable,然后问我什
: 么情况下需要mutable,这样说来我就真不知道了,谁来解答一下
: 2. order of construction for member variables.
: 3. extern 用法: extern int c = 0; 合法吗?什么情况下需要用extern,有什么优
: 劣性
: 4. static用法

q****x
发帖数: 7404
5
一听就是金融公司的变态题。

【在 S******n 的大作中提到】
: 第一个电话面试,答得不好
: C++的几道题
: 1. why mutable, when should we use mutable?
: 我就按定义说了,想在const成员函数里面改变member variable,就需要mutable
: 然后他说你既然把函数定义成了const,就不应该去改变member variable,然后问我什
: 么情况下需要mutable,这样说来我就真不知道了,谁来解答一下
: 2. order of construction for member variables.
: 3. extern 用法: extern int c = 0; 合法吗?什么情况下需要用extern,有什么优
: 劣性
: 4. static用法

M****g
发帖数: 162
6
LZ这是什么类型的职位阿?竟然问template metaprogramming...
q****x
发帖数: 7404
7
炫技而已。

【在 M****g 的大作中提到】
: LZ这是什么类型的职位阿?竟然问template metaprogramming...
S******n
发帖数: 132
8
C++ developer

【在 M****g 的大作中提到】
: LZ这是什么类型的职位阿?竟然问template metaprogramming...
S******n
发帖数: 132
9
什么意思?能举个例子吗?

【在 l*****a 的大作中提到】
: 对于const variable 也可以用mutable
P*******1
发帖数: 1022
10
问那些technical 的问题。这种interview好难啊。
相关主题
请教一个const和non const的C++问题Bloomberg电面面经
问个C/C++概念的问题C++面试问题,供参考
C++问题3offer比较 求建议
进入JobHunting版参与讨论
T********3
发帖数: 72
11
要compile time得到结果???

【在 S******n 的大作中提到】
: 第一个电话面试,答得不好
: C++的几道题
: 1. why mutable, when should we use mutable?
: 我就按定义说了,想在const成员函数里面改变member variable,就需要mutable
: 然后他说你既然把函数定义成了const,就不应该去改变member variable,然后问我什
: 么情况下需要mutable,这样说来我就真不知道了,谁来解答一下
: 2. order of construction for member variables.
: 3. extern 用法: extern int c = 0; 合法吗?什么情况下需要用extern,有什么优
: 劣性
: 4. static用法

r****t
发帖数: 10904
12
这个不算细了,primer 里面都有了,细的是 primer 里面没有的。

【在 s******n 的大作中提到】
: 学习了,mutable确实很搞,这个帖子说的还算清楚吗?
: http://www.highprogrammer.com/alan/rants/mutable.html
: 就是说逻辑上函数是const的,但是实现上必须修改内变量。
: 啥金融公司C++扣得那么细

r****t
发帖数: 10904
13
这还叫难?

【在 P*******1 的大作中提到】
: 问那些technical 的问题。这种interview好难啊。
r****t
发帖数: 10904
14
这还叫难?

【在 P*******1 的大作中提到】
: 问那些technical 的问题。这种interview好难啊。
b*f
发帖数: 3154
15
mutable is to tell the compiler to be careful when optimizing this code as
the value of this variable can be changed outside of the current context.
For example,
int x = 0;
while(x == 0)
{
...
}
compiler will optimize away the comparison because within the context there
is no other way can change the value of x. But if you put mutable, compiler
will not do such optimization.
e***s
发帖数: 799
16
同问, compile-time得到结果是什么意思?

【在 T********3 的大作中提到】
: 要compile time得到结果???
q****x
发帖数: 7404
17
变。

【在 r****t 的大作中提到】
: 这还叫难?
l*****a
发帖数: 14598
18
class A
{
public:
mutable int i;
}
const A a;
a.i=1;
a.1=2;

【在 S******n 的大作中提到】
: 什么意思?能举个例子吗?
n*******s
发帖数: 482
19
isn't what you described for volatile ?

as
context.
there
compiler

【在 b*f 的大作中提到】
: mutable is to tell the compiler to be careful when optimizing this code as
: the value of this variable can be changed outside of the current context.
: For example,
: int x = 0;
: while(x == 0)
: {
: ...
: }
: compiler will optimize away the comparison because within the context there
: is no other way can change the value of x. But if you put mutable, compiler

b*f
发帖数: 3154
20
hah... my mistake, my mistake... how embarrassing...

【在 n*******s 的大作中提到】
: isn't what you described for volatile ?
:
: as
: context.
: there
: compiler

1 (共1页)
进入JobHunting版参与讨论
相关主题
内推纽约金融公司程序员C++ Q29: extern and const together
選offer Google vs Citadel请教一个const和non const的C++问题
关于去金融公司做软件 我给大家讲一个真实的故事问个C/C++概念的问题
问个C++的题目C++问题3
一个C语言概念题Bloomberg电面面经
1st Amazon phone interview (1hr)C++面试问题,供参考
C++ Q42: (C22)offer比较 求建议
再问C++a C question about global variable
相关话题的讨论汇总
话题: mutable话题: compiler话题: const话题: extern话题: variable