Showing posts with label interview. Show all posts
Showing posts with label interview. Show all posts

Wednesday, August 13, 2014

Interview Questions

http://www.extramaster.net/tools/downloadFromSlideshare/
http://www7.flamingtext.in/
http://www.tracephonenumber.in/

int(*(*fptr)(int, char))(float);
fptr is pointer to function (int, char) returning pointer to function (float) returning int

tasklet, priority inheritance
what are the step to add decoder in stagefright
how to use c++ function in c
lock vs spinlock, priority inversion,
how to collect ram dump,

how hashmap is implemented
diff. between dequeue and list
semophore and mutex
types of semophore
deleting null ptr, delete ptr twice

sleep and wait difference
pthread_exit and return function
what are the different way of threads synchronisation
what segments of a process are shared among threads
what is process. diff between threads and process
how to wait for completion of all threads execution without pthread_join()

how negotiation occur in gstreamer
stagefright, gstreamer, omxil. kernel av codecs

How is an Interrupt handled in Linux?
https://en.wikipedia.org/wiki/Longjmp#Simple_example
multithreading, test use of pthread_join(), pthread_detach(), pthread_exit

what is role of omx core
http://maemo.org/api_refs/5.0/beta/libomxil-bellagio/group__core.html

http://www.geeksforgeeks.org/multithreading-c-2/
http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp#introduction
http://www.studytonight.com/cpp/cpp-and-oops-concepts.php
http://www.ncooltips.com/2012/12/how-to-change-core-dump-file-path.html
http://www.moythreads.com/wordpress/2011/10/06/linux-core-dumps/
http://stackoverflow.com/questions/5311515/gcc-fpic-option
http://www.thegeekstuff.com/2013/01/mix-c-and-cpp/
http://koti.mbnet.fi/niclasw/MutexSemaphore.html
http://www.go4expert.com/articles/virtual-table-vptr-t16544/
http://www.programmerinterview.com/index.php/c-cplusplus/how-vtables-work/
http://www.studytonight.com/cpp/virtual-functions.php
http://www.learncpp.com/cpp-tutorial/125-the-virtual-table/
http://www.mytechinterviews.com/nth-to-last-element-in-a-singly-linked-list
http://ccppcoding.blogspot.in/2012/08/android-multimedia-interview-questions.html
http://cs-fundamentals.com/c-programming/memory-layout-of-c-program-code-data-segments.php
http://nandu310.wordpress.com/2009/11/09/memory-areas-in-c-language/
http://shareprogrammingtips.com/c-language-programming-tips/structure-of-a-c-program-in-memory-how-heapstackdata-and-code-segments-are-stored-in-memory/
http://www.devshed.com/c/a/braindump/the-mmap-system-call-in-linux/
http://duartes.org/gustavo/blog/post/anatomy-of-a-program-in-memory/
http://rsquared.sdf.org/gdb/mlats.html

An abstract class has at least one pure virtual function. This is standard C++ terminology.
Some people use the term pure abstract class to describe a class that has nothing but pure virtual functions
(in other words, no data members and no concrete functions). This is equivalent to Java interfaces.

http://stackoverflow.com/questions/8359322/how-to-share-semaphores-between-processes-using-shared-memory
semaphore is atomic counter which indicate the number of resource available.
Also, It is used for synchronization between threads.
sem_wait() decrements semaphore

Semaphore: Use a semaphore when you (thread) want to sleep till some other thread tells you to wake up.
Mutex: Use a mutex when you (thread) want to execute code that should not be executed by any other thread at the same time.
Spinlock: Use a spinlock when you really want to use a mutex but your thread is not allowed to sleep. e.g.: An interrupt handler within OS kernel must never sleep. If it does the system will freeze / crash. If you need to insert a node to globally shared linked list from the interrupt handler, acquire a spinlock - insert node - release spinlock.

Wednesday, February 20, 2013

C Snippet Output

What is the output of following code?
#include <stdio.h>
int main()
{
   printf("%d");
   return 0;
}
O/P: Garbage Value
***********************************************************************************
What is output of following code?
#include <stdio.h>
int main()
{
   int i=0;
   printf("%d,%d\n",i++,++i);
   return 0;
}
O/P: 1,2
*********************************************************************************** 
What is output of following code?
#include <stdio.h>
int main()
{
   int i=0;
   printf("%d,%d\n",i++,i++);
   return 0;
}
O/P: 1,0 
***********************************************************************************
What is output of following code? 
int main()
{
   int a = 5, b = 6, c;
   c = a+++b;
   printf("%d", c);
   return 0;
}
O/P: 11
***********************************************************************************
What is output of following code?
 int main()
{
   int key = 2;
    switch(key)
    {
        default :
            printf("In default\n");

        case 1:
            printf("In Case: 1\n");
    }
    return 0;
}
O/P:
In default
In Case: 1
***********************************************************************************
What is output of following code?
#include<stdio.h>
void main()
{
   char *strl="Indii";
   char *str2="ian";
   printf("%s\b\b%s",strl,str2);
}
O/P: Indian
***********************************************************************************
main()
{
  int a=2,b=3,c=4;
  printf(“%d%d%d”);
}

static int i=25;
Static int i;
main()
{
  Static int i;
  printf(“%d”,i);
}

struct bitone
{
  Int a:3;
  Int b:13;
  Int c:1;
}bit1;

main()
{
  printf(“%d”,sizeof(bit1));
}

main()
{
  char *str=NULL;
  strcpy(str,”an”);
  printf(“str);
}

main()
{
  arr[5]={1,2,3,4,5};
  printf(“%d”,-2[arr]);
}

main()
{
  char c=’\08’;
  printf(“%d”,c);
}

main()
{
  If(0.001-0.1f)
  {
    printf(“yes\n”);
  }
  else
  {
    printf(“No”);
  }
}

main()
{
  int a=2;
  a=˜a+2<<1;
  printf(“%d”,a);
}

Thursday, February 7, 2013

Linux Device Driver Interview Questions

How interrupt work?
What is use of Signals? What is use of abort signal? Where to use it?
What is diff. between device and platform device?
Difference between soft and hard real time. linux is real time or not?
What are the things real time depends?
What are the kernel debugging tools? How to use them?
What is the difference between kernel-drivers and kernel-modules

What is kernel panic? How it occur? How to debug and fix it?
What is trace32 simulator? How to use it?
What is debugfs? How to use it?
What is MMU? What is the role of MMU?
What is memory corruption? How to debug it?
What is cache corruption?
What is bit-flip?
What is useof L1 and L2 Cache memory?
(Note: L1- Faster but smaller in size and private to each cpu core
           L2- Slower but bigger in size and common to all cores)
How to disable L1 or L2 cache memory? (Note: from kernel config)
What is vmlinux? What are the modules it contain? How to build it?
What is memory scrubbling?
What is TLB (Translation lookup table)?
What is RTB, ETB, Page poisoing, slub debugging?
Describe IOMMU architecture?
What is cpu register corruption?

C++ Interview Questions

What is class in C++? What object in C++?
What is Abstraction and encapsulation in C++? 
What is virtual function? What is use of it?
What is pure virtual function? What is use of it?
What are the types of inheritance in C++? Explain it?
What is abstract class? How to use it?
What is abstract base class?
What is difference Between Interface and Abstract Class?
What are the different types of polymorphism in C++?
What is late binding and early binding? 
What is operator overloading? Explain with example?
What is function overloading? Explain with example?
What is Friend class? What is Friend function? Refer Link
What is template? How to use it?
Write code for base class inheritance using template
What is difference between reference and pointer?
What is size of Empty Class and Empty Structure?
How to call function of derived class using base class reference/pointer?
How base class object callas to derived class function in case of virtual function.
What is virtual pointer
What is the purpose of constructor
 

C Interview Questions

Audio Routing: https://lwn.net/Articles/551936/
Audio Mixing: http://alsa.opensrc.org/Dmix

http://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html
http://aarkloninfo.blogspot.in/2007/11/hidden-treasure-of-c-by-rajiv.html
Why and when to use static structures in C programming?
http://stackoverflow.com/questions/12138742/the-member-variable-of-a-static-struct-in-c
http://stackoverflow.com/questions/6013373/c-usage-of-static-within-a-struct

 
What is typedef in C?
What are the storage classes in C? Explain it? 
when to use volatile.
when to use register. 

How to convert Hex to Decimal?
How to convert Decimal to Hex?
How to swap nibbles in integer?
Write code for all sorting algorithms.
Write code for string reverse.
Write code for counting words in file.
Write code for atoi() and itoa().
Write code for strstr function.
Write code for string concate.
Write code for reversing words sequence in a sentense.
e.g. This is my first blog. O/P: blog first my is This. 
Write code for removing extra spaces in sentense.
Write code for counting occurances of substring in string.
Write code for singly linked list with add, delete, reverse, sort, display.
Write code for doubly linked list with add, delete, reverse, sort, display.
How to delete node if only address of node to be deleted is given.
Write code for creating mirror of given binary tree using C.
How to find same ancestor of tree.
How to find size of structure without using sizeof operatar?
How to declare different function pointers? 
How to check MACRO is defined or not in C? 
How to call cpp from for c and vice-versa.
Write a program to calculate the size of the structure with out using sizeof?
write a program to print ur name with out using conditional statements and conditional operators? 

Write a program to calculate sum of the indivisual digits until it becomes one digit?(ex:123456 sum is 21 and 21 sum is 3) 
Explain different elements of Makefile.
How to used Automake and Autoconf for building C/C++ libraries.
How to create shared library.