Software Engineer Intern Interview Questions
Software Engineer Intern Interview Questions
Interview Questions
Name
Date
Start Time
#include <vector.h>
int n;
if(argc > 1)
n = argv[0];
vector<int> v(100000);
delete [] stuff;
return 0;
int k = 3;
k++;
return &k;
void main()
int* p = foo();
void main(){
static int data[] = {0,1,2,3,4};
int** ptr = p;
ptr++;
*ptr++;
*++ptr;
// 1 1 1
// 2 2 2
// 3 3 3
// 3 4 4
#include<stdio.h>
int main(int argc, char* argv[]){
int flag = 0;
char passwd[10];
memset(passwd, 0, sizeof(passwd));
strcpy(passwd, argv[1]);
flag = 1;
if(flag)
return 0;
// Attack the strcpy by overflowing the stack buffer by providing an input of longer length
// which will overflow the stack and overwrite the value of flag
5 - Can static variables be declared in a header file in a C program? What happens when such a
header file is included from multiple source files?
6 – What is the difference between an abstract class and interface?
7 – How would you investigate a memory leak in C++?
8 – What are virtual and pure virtual functions?
9 – What is the l-value and r-value reference?
10 – What are the move constructor and assignment, what are their purposes?