Operating System Interview Questions
- 0of 0 votes
AnswersYou have a vector of 128 floats (float data[128]) in shared memory, an environment with 8 threads and a convenient function called barrier() that will block on each thread until it will be signaled by all 8 threads (a simple semaphore of 8 elements).
- mst September 22, 2019 in India
Write a pseudo-C parallel function that calculates the sum of all 128 elements storing it inside data[0]; the function can alter/destroy the content of the other 127 elements of data[].
thread_id goes from 0 to 7: it is constant and unique for each of the 8 threads.| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer Operating System - 0of 0 votes
AnswersTell me What Is the Google Android SDK?
- hemant.maigro April 05, 2019 in United States| Report Duplicate | Flag | PURGE
Accenture Applications Developer Operating System - 0of 0 votes
AnswersLinux has this nice command called *tree*.
- NoOne October 14, 2016 in India
If you did not use it, please take a look around.
You do not have to write one. BUT, you have to do something similar. Given a file name ( not a path ), and an initial directory, you have to list all the file paths, which matches the file name, case should not be considered.
Also allow regex match.
Again, the problem is non trivial.
It was expected to ask the right questions.| Report Duplicate | Flag | PURGE
SDET Algorithm Operating System - 0of 0 votes
AnswersThere is this nice tiny *nix utility called *wc*.
The idea here is :wc file_name
prints :
- NoOne October 14, 2016 in India
character count of the file.
Word count of the file.
Line count of the file.
You have to implement your own *wc* program.
NOTE: The problem is non trivial for 3 reasons.
It was expected to ask about the non triviality.| Report Duplicate | Flag | PURGE
SDET Algorithm Operating System - 0of 0 votes
AnswerConsider a system with three processes and four resources. Resource R1 and R3 with one instance, R2 with two instance, process P1 holding an instance of R2 and waiting for r1,process P2 is holding an instance of R1 and R2 and waiting for R3,process P3 is holding an instance of R3. Is it possible to apply the Resource allocation graph algorithm to avoid deadlock? Explain.
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 0 votes
AnswersConsider a disk drive with the specifications of 16 platters, 2 surfaces, 512 tracks, 2K sectors and 4KB page or sector size. What is the capacity of the disk drive in terms of bytes?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 0 votes
AnswerConsider a system where counting semaphore initialized to +17, on this semaphore variable the various operations like 23P, 18V, 16P, 14V and 1P are performed. Then what is the final value of semaphore?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 0 votes
AnswersLet the average process size be s bytes and the page size be p bytes. Furthermore, assume that each page entry requires e bytes. Derive the optimal page size.
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 0 votes
AnswersProcess ID Arrival Time Burst
- D PRAVEEN KUMAR September 26, 2016 in India
P1 arrived at 0 and need10 units burst time, P2 is arrived at 1 and need 8 units of burst time, process P3 is arrived at 2 and need 6 units of burst time and process P4 arrived at 3 and need 4 units of burst time.
Assume that context switch takes one unit of time. Draw that gant chart and find the average waiting time, turnaround time using SJF scheduling.| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 0 votes
AnswersFive jobs are waiting to be run. Their expected run times are 9, 6, 3, 5, and X . In what order should they be run to minimize average response time?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 2 votes
AnswersDifference between a crash and exception.
- avinash September 20, 2014 in India for GTSC
Difference between macros and inline functions.
Mfc: message maps and virtual functions.
Different calling convention.
Late n early binding...
Garbage collector algorithm. When gc will fail to clean the memory.
How to know heap size, crash dump analysis, What is a stack n how to know stack memory size.
Commands in windbg.
Questions on Critical section, mutex, semaphores. Can we use mutex in single process and how?
Working of MSIL and JIT COMPILER.
Can a C# code, use c++ code and call kernel functions like createfile.
Areas: dot net, oops, operating systems, thread synchronization.
Difference in execution steps of c++ and c# code| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Assembly C++ Data Structures Debugging Object Oriented Design Operating System Threads - 0of 0 votes
AnswersJava runs on a "virtual" stack machine inside JVM, which has instruction of size of one byte (called byte-codes). How many instructions/bytecodes potentially can such a machine have?
- rahul23111988 August 22, 2014 in United States
PICK ONE OF THE CHOICES
256
Unlimited
2^32 for 32-bit machines
Depends on JVM version| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Java Operating System - 0of 0 votes
AnswersIn a multi-threaded application, many threads are trying to access the same
- rahul23111988 August 22, 2014 in United States
resource, say a global c ount, g. Threads are synchronized by the following code
(assume lock is a static int variable, initialized to 0 (unlocked state)):
if (lock) wait(); // It's already locked so wait(sleep) till someone wakes me up
else lock=1; // I locked it
/* Critical Section - Increment g */
lock = 0; // Lock released, so wakeup only one of other waiting threads, if any
What is the issue with this synchronization?
PICK ONE OF THE CHOICES
No issues – will work correctly
Works only on a uniprocessor system and would not work on multiprocessor system
Will not work on any system
Cannot say – need more data| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Operating System - 1of 1 vote
AnswersIf you run the same program twice, what section would be shared in the memory?
- farzanmoofty August 12, 2014 in United States for Price history
Follow up, is the text portion of memory share? Why not?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding Operating System - 0of 0 votes
AnswerWhat are the various ways of doing IPC in Unix/Linux? How do you implement it?
- farzanmoofty August 12, 2014 in United States for Price history| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding Operating System unix system programmin - 0of 0 votes
AnswersGiven a 20 GB file and 2GB RAM, how to parse it and detect where to break it, concepts of memory management.
- Saurabh2816 August 10, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Operating System - 1of 1 vote
AnswersWhat is the following program trying to do?
#define SIZE (1<<31) // 2 Gb int main() { char *p=malloc(SIZE); memset(p, 0, SIZE); }
a. Trying to crash OS by allocating lot of memory
- anil.auece July 31, 2014 in United States
b. Trying to calculate amount of system memory
c. Trying to allocate virtual memory and makesure memory is in physical memory
d. It is a useless program because the system will not satisfy memory request| Report Duplicate | Flag | PURGE
Cavium Networks Software Engineer / Developer Operating System - 0of 0 votes
AnswersImplement printf() library function using system-calls assuming a single argument which is a string
eg: printf("Hello world\n");
- anil.auece July 31, 2014 in Indiavoid printf(char *str)
| Report Duplicate | Flag | PURGE
Cavium Networks Software Engineer / Developer Operating System - 0of 0 votes
AnswerImplement sleep() in kernel mode using C-pseudo code
- anil.auece July 31, 2014 in Indiavoid sleep(int seconds) {}
| Report Duplicate | Flag | PURGE
Cavium Networks Software Engineer / Developer Operating System - 0of 0 votes
AnswersImplement a trivial spinlock and spinunlock functions using C-pseudo code eg: spinlock(&lock);
void spinlock(int *lock){}
- anil.auece July 31, 2014 in Indiavoid spinunlock(int *lock){}
| Report Duplicate | Flag | PURGE
Cavium Networks Software Engineer / Developer Operating System - 0of 0 votes
AnswerWhich one of the following applies to multi-core system?
- anil.auece July 31, 2014 in India
a. Multiple users can use the system at the same time
b. The kernel can run in SMP mode
c. Multiple tasks can execute in parallel without the need for scheduling
d. semaphores and mutexes should be replaced with spinlock| Report Duplicate | Flag | PURGE
Cavium Networks Software Engineer / Developer Operating System - 0of 0 votes
AnswersWhat are the differences between interrupt and exception?
- anil.auece July 31, 2014 in India| Report Duplicate | Flag | PURGE
Cavium Networks Software Engineer / Developer Operating System - 0of 0 votes
AnswersExplain how page fault and segmentation fault is handled/resolved
- anil.auece July 31, 2014 in India| Report Duplicate | Flag | PURGE
Cavium Networks Software Engineer / Developer Operating System - 0of 0 votes
Answerswhat is the use using 8 GB RAM in Operating System if we can manage a process with 2 GB RAM in 32 bit and 64 bit Operating System.
- premnath.velmurugan February 19, 2014 in United States| Report Duplicate | Flag | PURGE
Morgan Stanley Software Engineer / Developer Operating System - 0of 4 votes
AnswersGiven a kernal code in "0"th machine. How soon you can replicate the kernal across N machines. Now if the machines has upload and download bandwidth constraints, how can you impove the copy time.
- Guy January 24, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Operating System - -2of 4 votes
Answersdifference between thread and process.
- shakib034 October 27, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Operating System - 2of 10 votes
AnswersHow many times “Hello World” is printed by following program?
- whatsmyname1993 October 22, 2013 in India
int main()
{
if(fork() && fork())
{
fork();
}
if(fork() || fork())
{
fork();
}
printf(“Hello world”);
return 0;
}
a. 16
b. 20
c. 24
d. 64| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Operating System - 4of 4 votes
AnswersYou have written a memory manager and after using it your coworker complains that he is facing severe issues of fragmentation. What could be the reason(s) and how can you fix it
- vik October 04, 2013 in United States| Report Duplicate | Flag | PURGE
NVIDIA Software Engineer / Developer Computer Architecture & Low Level Debugging Operating System