Home » List of Companies » Swift
Swift C++ Interview Questions
Swift was looking for C++ developer with good experience with Linux, Shell-Scripting, Databases.
Questions on C++
Different questions were asked from the blow C++ programs.
Questions 1:
namspace myutil
{
/* Generates random secure auth key */
std::string gen_sec_key()
{
// ...
// returns some random key
}
class AuthKey
{
private:
const std::string key;
int accessCounter;
};
} /* namespace myutil */
int main( int argc, char** argv )
{
AuthKey k1;
const AuthKey k2( k1);
std::cout << "AuthKey = " << k2.getKey();
}
Questions 2:
#include <iostream>
#include <cassert>
using namespace std;
int main()
{
auto y = [] (auto first, auto second){
return first + second;
};
auto z= [] (auto y, auto f, auto s){
return y(f, s);
};
assert(z(y,4,5) == 9);
return 0;
}
Question on LinuxGiven an input file with following contant, find the sum of second column -
a 1
b 2
c 3
d 4
e 5
Ans should be: 15
Other Categories
MCQ on C Programming MCQ on C++ Programming Basic Computer Questions Solved C programs Solved C++ programs