Sie sind auf Seite 1von 5

1.

OS Concepts:
Reetrancey Procedure:
A Reetrancey procedure is one in which a single copy of a program is shared between mulitple
users at same point of time. It will have a permanant part and temporary part
permanant part: Instructions that make up the procedure
Temporary part: a pointer back to the calling program as well as memory for local variables used by the program
2. Os as a User/Computer interface:
Program development
Program execution
access to I/O devices
Controlled access to files
System access
Error detection and response.
3. Batch multiprocessing and time sharing: both uses multi programming
Batch Processing
maximize the cpu usage
job control language commands provided with the job
time shareing
minimize the response time
commands entered at the terminal
4. Five therotical advaces in devolping Opearing systesm
process
memory management
information protection and security
scheduling and resource management
sytem strucute
5 .Jacketing : Technique to overcome blocked state inside a ULT threading .
For example, instead of directly calling a
system I/O routine, a thread calls an application-level I/O jacket routine. Within this
jacket routine is code that checks to determine if the I/O device is busy. If it is, the
thread enters the Blocked state and passes control (through the threads library) to
another thread.
What is a process control block:
A process control block is a structure maintained by the kernal for each process. It consists of the
process id, its execution state and other information. When ever the process switching occures os
will push the PCB into the stack and retrieves it back one the process gets its time slice.
While process switching the PCB also stores the cureent execution address also.
Multithreading: The ability of an OS to support concurrent paths of execution , with in a process .
Advantages of using threads :
1.Creating and termination is easier than a process creation/termination.
2. Switching between threads is easy than switching between process(Context switching).
3. Communication b/w threadss is easier than that of process . It needs kernal interfearance for
protection and all.

Examples where threads would be useful:


Asynchronous processing fetcing data from DB, Network runs under separate thread.
Foreground and background process States of threads:
Spawn, block, unblock, finish
User Level and Kernal Level Threads:
ULT:
By default, an application begins with a single thread and begins running in
that thread. This application and its thread are allocated to a single process managed
by the kernel. At any time that the application is running (the process is in the Running state), the application may spawn a new thread to run within the same process.
Spawning is done by invoking the spawn utility in the threads library. Control is
passed to that utility by a procedure call. The threads library creates a data structure
for the new thread and then passes control to one of the threads within this process
that is in the Ready state, using some scheduling algorithm.
Advantages:
1. No need of kernal mode privileges for thread switching.(no need to User to kernal and
kernal to user back again).
2. User has the ability to choose the scheduling of threads (some have advantage of RR and
some have advantage of priority).
3. ULT can run on any process.
Disadvantages:
1. When a thread calls an I/O call the process and all the threads inside it will be blocked until
it reutns from I/) call. [ A way to come out of this is Jacketing techinique. In which it will
check weather the device is busy or not and if it is then the thread library switches to other
thread once the device is free again the thread waiting for it gains the control.
2. Disadvantage in multi processor system. Each process will have a processor assigned to it.
But it cannot happen here bcz all the threads inside a process will have a single processor.
Kernal Level Threads:
In a pure KLT facility, all of the work of thread management is done by the kernel. There is no thread management code in the application
level, simply an application programming interface (API) to the kernel thread facility. Windows is an example of this approach.
Symmetric Multiprocessing:
SISD Single instruction single data
SIMD
MISD
MIMD
Atomic Operation:
A sequence of execution statements with in a process where in which the switching or any kind of
interrupt should not happen.
Critical Section:
A section code where it tries to acquire the shared resource and that must not be executed if another
process is executing and using that shared resouce.

DeadLock:
A situation in which a process is waiting for a resource which is held by another process and that
process is waiting for the resource which is held by the first process. OR
A situation in which two or more processes are unable to proceed because each is waiting for one of
the other to do something.
LiveLock:
A situaltion in which two or more processes are changing their state continously with the reponse
from other processes with out doing any useful work.
MutualExclusion:
If any one of the processes is in a critical section executing a shared resource. No other process
should may be in a critical section try to acqure the shared resource.
Race Condition:
A situation in which multiple processes are doing executing or processing on a shared data item.
And the result depends on the relative timing of their execution of the processes.
Starvation:
A situation in which a process is overlooked by the schedular even though it is able to proceed; it is
never choosen.

6. Def for Deadlock, mutual exclusion, starvation.


For Mutual Exclusion EnterCritical() and Exit Critical()
7. Semaphore(decrement locking , increment unlocking), BinarySemphore(takes o or 1 ),
mutex :Similar to a binary semaphore. A key difference between the two is that the process
that
locks the mutex (sets the value to zero) must be the one to unlock it (sets the value to 1). Condition
Variable ,Monitor ,Event Flags ,Mailboxes/Messages ,spin locks.
Condition Variable:
A variable that blocks a process until the condition is true.
Conditions for deadLock:
1. Mutual Exclusion.
2. Hold and wait.
3. No Premption.
4. Circular wait.
Dead Lock Prevention:
1,2,3,4.
Dead LockAvoidance:
Process Initiation Denial
Resource allocation Denial. (Bankers algorithm).
Deadlock Detection Algorithm : Some Matrix Algorithm ???
Dinning philosphers problem:

5 philophers , 5 plates and 5 forks But each require two forks atleast to eat.
Unix Concurrency Mechanisms:
pipes
Messages
Shared Memory
Semaphores
Signals
Memory Management:
Frame: A fixed length inside the main memory
Page : A fixed lenght inside the secondary memory
Segment: A variable length blcok inside the secondary memory.
Fixed Parition: Equal size frames Internal Fragmentation
Dynamic Partition Have exactly the same size of the process memory External Fragmentation

Compaction ( overcomes External fragmentation but it is time consuming).


Best fit , First fit and Next Fit Choose a memory slot which has less External
Fragmentation.
Replacement Algorithm: when the main memory is full with all blocked processes then a new room
should be created for the new process just by replacing the blocked processes . So which process
has to be replaced depends on the replacement alogrithm.
Buddy Systems : To oversome the External Fragmentation and compaction:
select a size s which is 2^U-1< s <= 2^U. Go on like this until u want a smallet possible size for s.
Simple paging:
Simple Segmentation:
Combined paging and segmentation : takes advantages of both paging and segmentation.
Logical Address , Relatvie Address and Physical Addresss.
Scheduling.
Short term scheduling, medium tem scheduling, long term scheduling
FCFS, round robin , shortest job next, shortest remaing time, Highest response ratio (prediction on
past inputs).
JAVA INTERVIEW QUESTIONS
http://www.interview-questions-java.com/
http://www.javabeat.net/examples/2009/02/18/what-is-transient-keyword-in-java/ - Know about
trainsient keyword in java
http://www.scribd.com/doc/16738161/Java-Design-Patterns-With-Examples#outer_page_87
JAVA Design patterns.
LINUX INTERVIEW QUESTIONS
http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html

ANDROID INTERVIEW Questions


http://www.geekinterview.com/Interview-Questions/Android
http://seminarprojects.com/Thread-android-interview-questions
http://www.androidinterviewquestions.info/2011_04_01_archive.html
Action Bar
Fragment
Stack View
Loaders
Tasks Single Instance, Single Top , Sigle Task
Async Task
Android NDK
NDK Debugging
Different tools used for developing UI. Creating layouts . Checking the best way.
Location , Maps, Search in Android
Notification Manager,
Custom Views,
9 patch images
http://java.sun.com/docs/books/jni/html/types.html JNI Types
http://www.javacodegeeks.com/2011/08/android-interview-questions-answers.html some more
intr questions
http://www.javacodegeeks.com/2011/08/android-interview-questions-answers.html General
Android Questions
AsyncTaskLoader:
AsyncTaskLoader is a bit easier to work with, because you don't have to write code that handles
activity configuration changes. However, AsyncTaskLoader has some limitations - you can't change
fragments in onLoadFinished, e.g. you cannot dismiss ProgressDialog if you decided to show one
while data is being loaded. Basically AsyncTaskLoader is intended load data for DataAdapters and
if you want only that - great, that's what I would recommend. If you need more UI changes after
data is loaded - use AsyncTask, and remember to handle configuration changes.
Wojtek.Luszczynski@agreeyamobility.net
Przemek.Mikus@agreeyamobility.net

Das könnte Ihnen auch gefallen