注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
蓬勃 問了兩組coding
第一組
1.1
Q: 25u - 50 會得出甚麼結果 (25是用uint_32表示)
A: 這題其實考會不會handle overflow (negative side). 25u-50 也會得出一個 uint_32 值。數學上25-50 = -25, 在unit_32表示下會變成 2^32 - 25.
1.2
Q: int i=5;
int &k = i;
j = i++;
What is the value of i and j
A: i = 6, j=5 (&k 不知道是幹嘛的)
1.3
Q: <opt1> for ( vector<string>::iterator it=my_vector.begin(); it 您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 使用VIP即刻解锁阅读权限或查看其他获取积分的方式 游客,您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 VIP即刻解锁阅读权限 或 查看其他获取积分的方式 Unlock interview details and practice with AI Curated Interview Questions from Top Companies

it++ performs the followingoperations: 1. create a copy of of it 2. increment it 3. return the original (non-incremented)it ++it performs the followingoperations: 1. increment it 2. return it
第二組
LC#20 變型題
給定vector<string> 檢查括號順序有沒有錯
ex. input = "[a[b]c{[asdfg]}]", "", "(a]", ")a2d("
返回 output = [true, true, false, false]
不知道是不是常態 面試官竟要我run and compile. 那 IDE很鳥 compile錯了只顯示行數 也不顯示錯誤的原因。花了大概20分鐘找錯,最後時間到了然後就問問題掛電話。這次大概掛了~
分享上來賺個人品
覺得有幫助的話塞點大米唄
|