Software Internship Interview Questions | Glassdoor

Software Internship Interview Questions

553

Software internship interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

How would you count the number of words in a string consisting of uneven number of spaces between words( not dictionary words)? With and without library functions.

3 Answers

With -Use Java String Tokenizer or split function

int wc(char *s) { if (!s) return -1; int wc = 0; /* prune initial continuous spaces */ while (*s == ' ') ++s; /* count spaces, i.e words! */ while (*s != '\0') { if (*s == ' ') { ++wc; s++; /* prune continuous spaces */ while (*s == ' ') ++s; } else ++s; } /* sentence can end without space, check last word has been accounted */ if (*(s-1) != ' ') ++wc; return wc; }

char str[] = "jdjd jdjd jriri"; count=0; for(i=0; i<=strlen(str); i++) { // str[i] while(str[i]==' ') { i++; } count++; while(str[i]!=' ') { i++; } }

You have two decks of cards, one normal 52-card deck and one 104-card deck with double every card. Is one deck better than the other if you wanted to get two black cards in a row?

3 Answers

Given an array of positive and negative numbers, give an algorithm that would find the sequence of numbers that give the largest sum. The numbers have to be in sequential order.

2 Answers

What is the angle between hour hand and minute hand at 3.15?

2 Answers

Given two arrays one with expected numbers and other with actual numbers determine which number is missing in the actual array

2 Answers

What would you name this function and how would you optimize it?

2 Answers

Print the nodes of a complete binary tree in level order.

2 Answers

What is the difference between a Class in C and an Object in C++?

2 Answers

What is the difference between a signed and unsigned integer variable type?

2 Answers

Write codes for the Nth Fibonacci number.

3 Answers
110 of 553 Interview Questions