Showing posts with label UNIX FAQ's. Show all posts
Showing posts with label UNIX FAQ's. Show all posts

Thursday, 22 August 2013

Unix Topic on Context switching

Context switching is the process of storing and restoring state of CPU such that multiple process can share a single CPU resource. The context switching is the essential feature of a multitasking operating system.

Scheduler will selects process from ready processes in memory and will allocate the CPU to that process.

Dispatcher module give control of the cpu to the process selected but the short term scheduler,this involves context switch,switching to user mode


Friday, 9 August 2013

Unix FAQ's - Embedded Trainees have to know this.



1. About socket programming

2. Difference between tcp and udp in programming

3. How to know list of files available in a directory

4. What are the extra options that can possible to give "ls"

5. How to know how many threads are running

6. Difference between semaphore and mutex

7. About compilers that we use.

Tuesday, 30 October 2012

Lipta Inc interview Questions

1)  Pointer to a constant sting and constant pointer difference (*p="Vector"  & p[7]="Vector")

2)    double f=89.9;
         printf"("%f", f);
        try with %g and %e ,%d also and check the o/p;

3)   which one should be used in case of constructor ?
        pointer /refrence parameter
   
          And Explain why?,supporting your answer.

4)  Explain copy constructor

5)    printf("%s","abcdefgh[4]);
        check with %c and %d

6)  Task control block(PCB)
        where it is created????
        when it destroyed ???   
       
7) If you have to design some task,,what  SCI's will you require???
        He asked like " I want to design one task ......what will i need??

8) Write a prototype of pthread_creat()

Sunday, 14 October 2012

UTC interview questions


First 3 rounds:
1. volatile. purpose? avoiding time optimization or Memory optimization?
2. What are the synchronisation mechanisms used? 
    semaphores vs Mutex? Question extended to processes waiting on semaphore?
3. How shared memory is implemented?
Adv and disadv of shared memory?
4. Have u ever worked on pipes?
5. Working mechanism of message Queues. Disadv of message queues?
6. different storage sections 
7. protected vs private?
8. what is polymorphism? How do u achieve it?
9. Late binding vs Early binding?
10. What is the mechanism involved in late binding? (VTABLE concept) 
11. Single ton pattern
12. OS vs RTOS
13. what is Priority Inversion?
14. How do u achieve class behavior(data members + Member functions) in C? Similar to the lines of how to declare a function in structure in C?
       Write a small piece of code to do it and access it? 
15.  What is an Exception? Why we can't handle asynchronous exceptions in C++?
16. write the syntax for copy constructor and Assignment operator?
17. (i)A ob1 = ob2;  which one is called ? copy contructor or Assignment operator?
       (ii)A ob1; A ob2;
       ob2 = ob1; which one is called?
18.  What is Context switching? what OS do while switching?
19. Few questions on structure padding. 
20. Program to interchange elements in a Matrix?
21. Reversing a Linked List.
22. Write a pgm to know whether a system is little endian or big endian? extended the question to are there any alternate methods?
23. memory leaks?
24. select() system call? 
25. Purpose of virtual destructor?
26. Can we have virtual constructor?
27. Have u worked on UML? Represent diagramatically a composition?
28. Questions on Inheritance Acess specifier modes? 
How the base class members are inherited, When the acess specifier is public/private/Protected?
29. Abstract classes? When do u go for an abstract class?
30. What happens when u don't define a pure virtual function in the derived class?
31. Interrupt Handling mechanism(RTOS)?
32. Explain the mechanism of RS232?
33. Overloading postfix and prefix operators?
34. system calls on Client side and server side(Socket Programming)?
35. Different states of a Process?
36. Syntax of function pointers?
37. What is preemptive based scheduling?(RTOS)
38. What is encapsulation? What is data abstraction?
39. Shallow copy vs Deep copy?
40. What do the C++ compiler provide u by default?
41. Size of an empty class?
42. Object Slicing in C++?
43. Stack Unwinding in C++?
44. What is Segmentation fault? Questions related to Core dump.
45. diamond problem in C++? How to resolve it?
46. questions related to malloc(), calloc()  and realloc()
47. const char*p;
       char const *p;
       char *const p;
48. Overloading new operator?
49. what is a Smart pointer in C++?
50. how do u allocate memory for a double pointer?
51. What is a Race Condition? extended the question to thread-safety?
52. Indirect question referrring to Reference Counting in C++?
53. What is double buffering technique?
54. fork() system call?
55. What is Deadlock? How do u prevent it?

4th Round - All Process related 
1. Have u worked on Interrupt Handlers?
2. What are the design methodologies used?
3. Different diagrams in UML?
3. How do the Code Review process is done?
4. He has given a scenario and asked me to design it.

Sunday, 17 June 2012

FAQ on UNIX,C,C++,NETWORKING



1. In which layer are packets formed ( in network layer).

2. What are virtual functions?

3. What is a scope resolution operator?

4. Write a program to concatenate two circular linked lists into a single circular list.

5. Write a program to reverse a linked list.

6. Base class has some virtual method and derived
        class has a method with the same name. If we initialize the base class pointer with derived         object,.calling of that virtual method will result in which method being called?   Ans--- derived         method.

7. Go through virtual functions concepts in C++ and how the pointers to functions would be handled.---            aztec

8. A thread is  Ans. Detachable unit of executable code).

9. In the command scanf, h is used for   Ans. Short int.

10. How is memory management done in Win95   Ans. Through paging and segmentation.

11. What is meant by polymorphism  Ans. Redfinition of a base class method in a derived class.

12. How is linked list implemented  Ans. By referential structures.

13. What method is used in Win95 in multitasking  Ans. Non preemptive check.

14. What is meant by functional dependency.

15. What is a semaphore Ans. A method synchronization of multiple processes .

16. Preorder of A*(B+C)/D-G     Ans.*+ABC/-DG.

17. What is the efficiency of merge sort  Ans. O(n log n).

18. In which layer are routers used  Ans.In network layer.