Round 1: Online Assessment
Questions:
-
Check if a number's binary representation is palindrome or not.
- Note: This question only had language option in C. No option to code in any other language than C.
-
Some students and their heights are given, then an arrangement is given about how they are standing, print the indexes which are standing at the wrong index if the students have to stand heightwise increasing order.
- Note: This question was allowed to be solved in C++.
-
Programming Languages Round:
- This was a MCQ round with syntax-based questions, focusing on pointers in C language.
-
Aptitude Round:
- Included 5 basic aptitude questions that high school students can solve.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 2: Face to Face Interviews
Questions:
- Write the syntax of a void function pointer that takes input of two integers and then assign this function to a real function.
- Malloc Syntax related question, what does malloc return?
- What are static variables, difference between static and global variables?
- If a struct stores 2 integers and 1 char how much memory does it occupy, follow up: Where is that padding stored internally?
- Find the middle of Linked List, follow up: If even number of nodes, what would the code return how can we configure it?
- How to avoid deadlock: 4 conditions.
- Difference Between struct and union.
- Reverse the words in a sentence, write code on paper.
- Explain one project in detail.
- Some super hard pointer related questions.
- Difference between semaphores and mutex.
- Difference between declaration, initialization and definition for a variable.
Follow-up Questions:
- If we use malloc(0) what would happen?
- Write syntax to declare an array of size 10 that stores pointers to integers, and then declare a pointer to an array of size 10 that stores integers.
- A syntax like
what would *ptr return?int x = 10; int *ptr = x; ++(*ptr);
- Find duplicate element in an array containing numbers 1 - n where 1 element has a duplicate.
- Puzzle: If there are 4 jars with infinite 10g balls and 1 jar with infinite 9g balls. If we can only weigh once how would we detect the defective jar?
- Mutex: why do we use them?
- Static variables, ever heard of volatile keyword why do we use it?
- Discussion on have you ever studied compiler design, written assembly code.
Candidate's Approach
I struggled with a lot of pointer syntax questions and was nervous. I answered most of the questions and puzzles, but got stuck at times and confidently gave wrong answers to some pointer-based questions. I felt the second interview went a lot better than the first.
Interviewer's Feedback
No feedback provided.