Showing posts with label Questions. Show all posts
Showing posts with label Questions. Show all posts

Monday, April 8, 2013

Practice Sets





Practice Set


1. use of volatile and const volatile
2. AAC vs MP3, which is better
3. how to check endianess
4. Shallow copy vs Deep copy
5. Copy Constructor
6. Operator overriding
7. 25 horses 5 racing track and u need to find the fastest three horses in minimum iteration?
8. how does container takes care of AV Sync?
9. Why Audio is master?
10. What is Bayer Image?
11. What is the difference in kmalloc and vmalloc.
12. RTP streaming - frame synchronization and wall clock.
13. OpenMax codec Integration.
14. Copy_from_User and Copy_to_User
15. Use of Neon Instruction
16. Address mapping in device driver
17. pthread, signalling mechanism.
18. structure padding
19. Stagefright A/V Sync.
20. Use of Audio Policy manager.

It's Answer Discussion Time , Please comment your Answers for Favourite Questions!! Hurry Up!!



After getting over with Practice set questions , I dont see any Answers  getting discussed. Ok looks like trivial questions ah

         Answer Time :

1.  use of volatile and const volatile

Both the types are made not to get optimised by compiler.

By defining volatile , its been instructed to compiler not to change variable priority , always check for
its fresh value, Dont pick from cache.

Its best used with the hardware interaction , where we will be having registers to store the state of hw resource.
ex - unsigned int volatile *status_reg;
       unsigned char volatile *reg_addr;
#define set 0x00000001

int res_register_fd( ) {
while((*status_reg&&set) ==0) {
}

return *reg_addr;
}


const identifier with volatile says the register value / variable value can not be modified anytime within the program. It can only be updated by external hardware resource.

So for improving above example for registers storing the hw resource status
we will be declaring variable as :

       unsigned int const volatile *status_reg;
       unsigned char const volatile *reg_addr;


2. AAC is better than MP3 .AAC provides you variable bit rate easily however mp3 would need more effort, better error resilence, better compression , and easy encoding algo. It provides better quality at same bit rate. AAC offers sampling frequencies between 8 kHz and 96 kHz and any number of channels between 1 and 48. Mp3 supports limited channels. AAC has different encoding schemes to provide better compression -

a.AAC - Low Complexity  = AAC/ AAC_LC

b1.HE-AAC v1   aacPlus v1
common name -  eAAC, AAC+, CT-aacPlus
         Encoding - AAC LC + SBR
Standard -
ISO/IEC 14496-3:2001/Amd 1:2003

b2.HE-AAC v2aacPlus v2,  common name - eAAC+, AAC++, Enhanced AAC+
       Encoding - AAC LC + SBR + PS(Parametric Stereo)             
Standard - ISO/IEC 14496-3:2005/Amd 2:2006
c. AAC_ELD -it is a codec targeting speech coding usecases, by meeting the real time requirement of speech codec(low algorithmic delay), as well as providing much better quality than typical AMR-NB/WB codecs that are usually used for speech coding/VOIP apps.




I will make a separate post to discuss more on AAC and different toppings on this - SBR , PS :)


Tuesday, March 19, 2013

MCQ - Multimedia Common Questions

AUDIO:

What are the audio file types , mime types and container formats you are aware of ? 
What is the difference between AAC-LC / AAC+ / eAAC ? 
What is the difference between AMRNB and AMRWB
For which apps AMR is preferred over AAC ? 
Which Music quality is better - MP3 / AAC ? Why ?
Can we play 5.1 channel audio content on android handsets ? If so, in which android releases ?
How do you verify that the audio output of music playback is indeed  correct ? 
What is the audio routing strategy used in android when you have multiple audio output devices such as BT headset, etc ?
What is the difference between Speech recorder and Sound recorder app ? 
What is echo cancellation  noise suppression and audio effects support available in android ?
What is Sampling frequency?What do you mean by 48Khz?
What is bitrate ? what does 128Kbps mean.
What is significance of Audio Flinger and what does it do?
Explain the Threads running in Audio Flinger?
What is the work Mixer thread? How is Fast Mixer thread different.
What is ALSA , How is it interacting with Audio Framework.
What is Periodic Buffer. What are latency, buffer periods and size.
Explain the Audio Encoding/Decoding flow
What is PCM? what is difference between 16-bit and 32-bit PCM
What is difference between Audio Sink and Audio Output
How is Audio Track being written
What would be impact of CBR and VBR on the Audio
How will you take PCM sample dump.

 

VIDEO:

What are the video  file types , mime types and container formats you are aware of ? 
Which video format is preferred in digital TV ? 
How do you convert video of one resolution to another ? 
What is aspect ratio ? what are the standard values used for video ?
What are the raw video formats that can be rendered to any display device ? What is the difference between those raw formats ?
How will you check the frame rate to be 30fps for encoding as well as decoding.
How will you dump the YUV frames.
What is Surface Flinger. How does video rendering happen.
What is hardware composer. How does Composition happen.
What will be the impact if the video buffers get stuck within decoder. and how will you handle. 


CAMERA
 
 1. camera kernel and HAL interaction 2. Sensor data to HAL 3. Sync between preview and Encoding 4. Bayer Format and resolution 5. ISP functionality 6. How does buffer gets exchanged from HAL to driver 7. What driver is doing 8. Preview frame drop 9. camera service functionality 10. flow from start preview till encoding via capture 11. block diagram of camera module . 12 . JPEG encoding flow in general 13 . DCT vs DFT vs Wavelet for JPEG 14. ISO significance 14. 3A need 15. How does a capture wroks Optics perspective 15. video snapshot functionality 16. how will you make use of multiple core to improve capture usecase?16. What will happen with preview and camera buffers if encoder is slower during recording.
 
IMAGE 
What are the video  file types  and mime types of Images you are aware of ? 
What happens when we view a GIF animation file in android device ? 
What are SMIL files and where are they typically used ? 
What are SVG files and where are they typically used ? 
What are PNG files and where are they typically used ? 
what is the difference betewen BMP and WBMP files ? 
Have you found any issues related to slideshow / thumbnails in gallery / sliding through the gallery ?



METADATA:
What is album art ? 
What is genre ?
What is ID3 tag ?
How do you validate the metadata fields ? 


GENERAL:
What are the different types of streaming for multimedia contents ? What is the difference between each of them ? 
How can we create RTSP streamable contents when a normal 3gp file is given ? 
What RTSP servers are you familiar with and which 3gpp standard did those servers support ? 
How did you measure jitter in RTSP/RTP streaming ? 
How do you measure video playback performance and verify audio-video sync ? 
Which multimedia framework is used in Android ? 
What multimedia codecs are used in Android - SW codecs, DSP codecs or HW codecs ? What is the difference between each of them ?
What are the performance issues /  power management related / quality-related issues you have reported ? 
which is the most complex/difficult issue you have found and reported ?
What happens if we rename the extension of media files such as rename .mp3 to .3gp , .3gp to .jpg , etc.. ?

Wednesday, March 13, 2013

Real Interview Questions set 2

           

Programming :

1. Write a program to allocate 2-D memory.
Ans:
Allocating 2D memory can be taken as two dimensional array , where row can be allocated first then column using double pointer.

int **p;
p = malloc( rows * sizeof(int*));

for(int i = 0; i{
*(p+i) = malloc(column * sizeof(int));
}

One can also assign some character pattern to this two dimensional memory.

2. Write a program to draw circle with 1 at circumference in a NxN matrix = {0}.
Ans:
1. Divide the entire Matrix in four equal part.
2. In first quadrant , Arc can be drawn and replicate for other 3 quadrant.
3. To draw an Arc by 1 over the 1st Quad Matrix of N/2 x N/2, Assign the value 1 to all the point which should lie on circumference of the circle.
4. Centre of Circle = {N/2,N/2}
5. Radius = {N/2}
6. In 1st quad starting from first row i.e.  x = 0 , the y co-ordinates to lie on circle circumference should come as per formula Sqr(x-a) + Sqr(y-b) = Sqr(radius)
so y would be    Sqroot{|Sqr(N/2) - Sqr (|x - N/2|)|} for x vary from 0 to N/2 to form an Arc.
7. Assign the array value to 1 for obtained (x,y).

3. Write a program to implement itoa().
4. Write a multi-threaded parallel program to solve the equation :
 10a + 10b + 10c + 10d.
Assuming there are four cores.
5. What is the O/P of

a) int main() {
           printf("%x", main());
           return 0;
}

b) int main() {
int a = 11;
char *str = "nvidia";
char arr[10] = "talk";
strcpy(str, arr);
}

c) if(malloc(0) != NULL) {
      printf("good");
     } else {
       printf("bad");
     }

d) int a = -20;
    unsigned int b = 6;
    if(a>b)
      printf("unsigned");
     else
      printf("signed");
e)  int main() {
      fork();
      fork();
      fork();
      printf("hello fork");
     }
and Explain.

6. Explain the high level flow of Android Video playback.
7. What do you mean by Data tunneling.
8. What are the different System Signals
    SIGABRT - Abnormal termination
    SIGFPE - erroneous Arithmetic operation
    SIGILL  - illegal instruction.
    SIGINT - interactive attention signal
    SIGSEV - An invalid access to storage
   SIGTERM - termination request   etc
can refer
http://en.wikipedia.org/wiki/Unix_signal
9 . Which mp4 atom is responsible sync for I - frame.
10. Explain RTSP streaming.
11. Explain state transition of OMX Component.
12. Explain the AV Sync logic.
13. Try to explain the high level logic of Audio recording.
14. find out the average of two number efficiently
     a>>1 + b>>1
15. Lets say input is N = 1000 0000 0000 0000 and M = 10101
copy M into N from position i = 2 to j = 6th of N.
O/P should be N = 1000 0000 0101 0100
16. Lets say there is an integer a , extract the position of different value c from the set (0,1,2,3)
as bits in a and save the position value in b. Write a macro for this
c = Extract_bit(a,b);

#define Extract_bit(a,b)   .................................
17. What are the video artifacts have you observed. Can you explain the reason behind them.
18. What are the Green frames. What does it signifies. Why is it green by the way?
19. What does the Grey frames indicate.
20. Write a program to calculate the amount of loan repayment year , where you have taken loan of amount P with rate r% annual. You do payment of amount A every year.

puzzles:

1. In a Cricket Match , there are two balls remained , and last pair is on the pitch with seven runs remained to win. In what there will be win for batting team.

2.  There is long number having total digit count to be 1996 like
  abcdef ........1996  each two digit pair in the number is either divisible by 17 or 23.
find out the last digit of this number.

3. Number of zeroes in 100!

Sunday, March 10, 2013

Real Interview Questions set 1



C/C++/OS concept


Q1.  Brief me about yourself , skill and experience?
Q2 . Brief me about your experience related work?
Q3 . Why do you want to join Qualcomm?
Q4.  How much do you rate yourself in C,C++ , OS and Multimedia out of 10?
Q5. What are the storage classes? Tell the scope and life of each one?
Q6. What is the difference between static and global variable?
Q7. What is the use of volatile variable ? Give one example.
Q8.  What is the difference between Macro , Inline function and Template? Explain the advantages and disadvantages.
Q9.  Are you aware of RAM , ROM and Cache memory? Brief.
Q10. What is Segmentation fault. what are different segmentation fault?
Q11 . What do you mean by Paging . Why do we need it?
Q12 . What is fragmentation and How can you prevent this?
Q13 . What is virtual memory concept? Why do we need it.
Q14. What is difference between struct in C and C++?
Q15. What is function pointer? When do we use it? Give one example.
Q16. What is the difference between process and thread?
Q17. What is context switching? How does Scheduling happens?
Q18. What is Critical Section? How will you protect it?
Q19. What is difference between Mutex, Semaphore and Binary Semaphore?
Q20. What are different IPC mechanism? Explain each in short.
Q21. What do you mean shared memory among process? How will you implement it.

Q22. What is virtual function. How does pure virtual function different from it.
Q23 What is Abstract Class? How can we access the members of it.
Q24 What is friend function.
Q25. If A is base class and D is derived class . can we access the member of D using A's object .yes or no And how?
Q26. Explain ISR .Top/bottom halves mechanism
Q27. Difference between softirq , tasklet and workqueues.
Q28. What is Event Callbacks . Give one example.
Q29. What is a buffer . how does it gets allocation and maped to physical mem.
Q30. Explain System calls , how does it go from user space to kernel space.
Q31. What is Spin lock and how does it differ from mutex & semaphore.
Q32. Comparing int and unsignedint. what will be typecast.
Q33. What is Q-format. Where do we use it?
Q34. What is diff between floating and fixed point reference?
Q35. What is Static variable and function. Where do we use this. Explain Factory object model.

Programming Questions:
Q1.  Implement malloc of your own and explain in general how does it work.
Q2.  Implement memcpy ,memmove and memset.
Q3.  Reverse a given String in place
Q4.  Reverse a given single linked list and double linked list in place.
Q5.  Write a small program to find the endiannes of system. 
Q6.  Write a program to find palindrome word in a given string lets say My name is Nitin.
Q7.  Write a program to transpose a matrix 4x4.
Q8.  Write a program for matrix multiplication.
Q9 . Write a program to find the intersection of two linked list.
Q10. Implement Stack and Queue.
Q11. Write a program for Run Length Encoding in a given string.
Q12. Write a program to find a substring in a given string.
Q13. Write a program to enter the element in a sorted linked list.
Q14. Write a program to find loop in a linked list.
Q15. Write a program to replace s in given string by m  and m by s - "sy nase im sohit mingh"
Q16.  Determine whether linked list is circular or not.
Q17. Find the mid of linked list.
Q18. Give the ISR method signature and Write a small interrupt handler?
Q19. what does malloc(0) returns . is it NULL?
Q20. Write a multithreading program to print even and odd numbers till 100 using  two threads T1 / T2.
Where T1 will print  1 3 5 7 .... and T2 will print 2 4 6 ...

Bitwise questions:

Q1.  Swap Bit at mth and nth position from Right.
Q2. Toggle Bit at 6th position from Right.
Q3. Count number of 1's in given integer.
Q4. Swap bits from 0th to 2nd positon to 5th to 7th.

puzzles :

1. There is a long string of 15cm size . You need to cut them in minimum way and keep in such a way that you can generate any length string till 15 cm by tying them.

Use binary funda 1 2 4 8

- | -- | ---- | --------  , so there are only 3 cuts and you can generate any length string till 15 cm size.

2.  There are three boxes wrongly labeled as Apple, Orange and  Apple&Orange.You need to take out of one item from any of the one box and then tell the box label correctly in once chance.

[A]       [O]    [A&O] wrongly labeled

take out  one item from [A&O] box , if its apple then its Apple box , and [O] is wrongly labeled so it would be A&O , [A] would be Orange box . or similarly if its Orange out of the A&O box.

3. There are 10 cartoons of Cigar of 10 cigars in each of 10 grams each. In one of the cartoon 10 Cigars are packed of 11 gm each by mistake.  Find out the cartoon having 11 gm Cigars by measuring once.

place cartoon in a row , from left : pick one cigar from 1st cartoon  two from 2nd , three from 3rd and so on till 10 from 10th last one.

Weight them all , Ideally each Cigar weighs 10gm , so total weigh should be 10+20+30+40+50+...+100 =  550 gms

Now , If there is 11 gm Cigar in 1st cartoon from left then the above sum would have come as 551
if its in 2nd Cartoon from left then sum would have come as 552
3rd .....553
4th .....554
5th......555   .................if its in 10th then 560 gms


 ALL THE BEST
----------------------------------------------------- Thank You-------------------------------------------------------