0% found this document useful (0 votes)
26 views

BARC Interview Experience

The document is a transcript of an interview at BARC, detailing questions and answers related to C programming, data structures, algorithms, operating systems, and database management systems. The candidate discusses various programming concepts, including function definitions, memory allocation, binary trees, and normalization in databases, while also reflecting on preparation strategies for interviews. The document concludes with an invitation for further discussion on topics like BARC life and salary structure.

Uploaded by

dmarker331
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

BARC Interview Experience

The document is a transcript of an interview at BARC, detailing questions and answers related to C programming, data structures, algorithms, operating systems, and database management systems. The candidate discusses various programming concepts, including function definitions, memory allocation, binary trees, and normalization in databases, while also reflecting on preparation strategies for interviews. The document concludes with an invitation for further discussion on topics like BARC life and salary structure.

Uploaded by

dmarker331
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

BARC Interview Transcript

I wrote down my five favourite subjects as : C programming, Data Structures,


Algorithm, OS and DBMS.

First Panel Member asked Questions from C:


Q1: They started with a very basic question write a program to add two
numbers
i wrote the code. Then he asked what happen if we define the function just
below the main function will it work , i said no...then he said why i said
compilation done from top to bottom that's why it will not work. Then he
asked what is the solution then i said we have to define the function above
main function he said i want the definition below the main function, now
can you find the solution...then i said we have to declare the function at
the top...he was satisfied with my answer.
Q2: The second question was also basic: he asked write a program to find
sum of digits of a number.
I wrote the program. then he asked will it work for all numbers, i said no it
will not work for large numbers then he asked other than large numbers
will it work for everything i said yes, but he said no it will not work. he gave
me some time to think but i couldn't figure out and he said will it work for
negative numbers i said no because modulus operator is not defined for
negative numbers he was satisfied with my answer
Q3: How to return a set of values from function ?
I said i can use structure he said suppose too many values are there I said
i can use array..he said write the code...i wrote code simply with the static
array. He said what if the size of array is unknown i said we can use dynamic
memory allocation and he said write the code to demonstrate it...i simply
write the code using malloc now he said why you are you typecasting the
memory into the integer pointer, won't it work without that i said it will
work in new compiler but in old compiler it won't work ... after that he
asked what is difference between static allocation and dynamic allocation:
i said it will totally depend on use case ...he said tell me the use case . I said
when the size of array is not know we will use dynamic memory allocation
on the other hand if known we will use static memory allocation. He said
can you say other use case... I was literally unable to figure out... finally i
said in dynamic memory allocation there will be no tension to deallocate
the memory, they literally laughed at my answer but that laugh was not
sarcastic at all. He gave me some hint if we return the integer pointer from
that function what will happen....now i found out the other use case...I said
if we use static allocation that memory will be created in stack and its
lifetime is till the block so if we return that memory pointer that will be
inaccessible at the end on other hand if we return the memory pointer
using dynamic memory allocation it will be accessible till the program runs
.He was satisfied with my answer
Q4 : what is difference between int * and char * ?
i said if we defrenced using int * pointer it will access 2B on the other hand
if we derefernced using char * it will access 1B.. he said suppose if we assign
integer address into a character pointer. If we derefernced using char ,can
you explain how memory will be accesed.. then i said it it will access first
1B of that integer. Now he asked lower byte or higher byte, then i said it
will depend on implementation, then he asked how many types of
implementation are there. I said two types: little endian and big endian. he
asked in detail about both the implementation. and at the end he ask what
kind of implementation is used in Intel cpu. i was not aware of it so i simply
said sorry. now the interview moved to Ds and algo discussion and a ds algo
panel member started his discussion

Second Panel Member asked Questions from DS + ALGO:

They asked me to create a binary tree node.


I created simply using structure data type
Next question was to return that binary tree node using c program.
Next question was regarding clone a binary tree .But he want me to clone
as well as mirror image the new binary tree. i couldn't understand the
question clearly so i told the panel member to make me understand the
question then he explained the question again with an example after that i
wrote the code as well as I was explaining to him while writing the code
and at the end I wrote code and explained, He was prettly satisfied with my
answer.
Next Question was to eliminate the common part from the tree. To be very
honest I don’t remember this question.

Third Panel Member asked Questions from OS:


The first was somwhat related to process state diagram and context
Switch. I don’t remember the actual questions and all the follow up
Questions.

Fourth Panel Member asked Questions from DBMS:


The first question was from foreign key and all and many follow up question
were there. The Second question was from 3NF conceptual definition and
I couldn’t explain this.. illy follow up question were there. It is a year ago,
so I forgot many things.
How To Prepare For the Interview :

• Choose your five subjects in which you are cofident enough.


• Go through notes of these five subjects.
• During Revision of notes, Don’t revise it from numerical prespective.
Try to find the answer of why and How.
• Go through standard books to deeply understand the concepts.
• Don’t memorise the concepts, try to understand it.
• Try to analyze possilbe follow up Question from the single concept.

Thanks a lot for reading this post. That’s all for the
Interview and all. Please Like, comment and repost the
post if you find it useful..

PS: If you want to know about the difference between OCES and DGFS. And
also you want to know about BARC Life, Salary Structure, Perks, etc. Please
comment down. I will cover these things in next post..

1.

You might also like