Operating Systems, Programming, and Web Development
- Fragmentation of the file system:
(a) Occurs only if the file system is used improperly
(b) Can always be prevented
(c) Can be temporarily removed by compaction
(d) Is a characteristic of all file systems
(e) None of the above
(Ans: C) - Which is a permanent database in the general model of a compiler?
(a) Literal Table
(b) Identifier Table
(c) Terminal Table
(d) Source code
(e) None of the above
(Ans: C) - Swapping:
(a) Works best with many small partitions
(b) Allows many programs to use memory simultaneously
(c) Allows each program in turn to use the memory
(d) Does not work with overlaying
(e) None of the above
(Ans: C) - Which scheduling policy is most suitable for a time-shared operating system?
(a) Shortest-job First
(b) Elevator
(c) Round-Robin
(d) First-Come-First-Serve
(Ans: C) - Semaphores:
(a) Synchronize critical resources to prevent deadlock
(b) Synchronize critical resources to prevent contention
(c) Are used to do I/O
(d) Are used for memory management
(Ans: A) - PHP is a widely used ______ scripting language that is especially suited for web development and can be embedded into HTML:
(a) Open source general purpose
(b) Proprietary general purpose
(c) Open source special purpose
(d) Proprietary special purpose
(Ans: A) - Which of the following functions require the `allow-url-fopen` to be enabled?
(a) include()
(b) require()
(c) Both of the above
(d) None of the above
(Ans: C) - The feature in object-oriented programming that allows the same operation to be carried out differently, depending on the object, is:
(a) Inheritance
(b) Polymorphism
(c) Overfunctioning
(d) Overriding
(Ans: B) - Examine the following program and determine the output:
#include <iostream> using namespace std; int operate(int a, int b) { return (a * b); } float operate(float a, float b) { return (a / b); } int main() { int x = 5, y = 2; float n = 5.0, m = 2.0; cout << operate(x, y) << "\t"; cout << operate(n, m); return 0; }
(a) 10.0 5.0
(b) 5.0 2.5
(c) 10.0 5
(d) 10 2.5
(Ans: D) - Find out the error in the following block of code:
if (x = 100) cout << "x is 100";
(a) 100 should be enclosed in quotations
(b) There is no semicolon at the end of the first line
(c) Equals-to operator mistake
(d) Variable x should not be inside quotation
(Ans: C) - Which of the following components of the .NET framework provide an extensible set of classes that can be used by any .NET-compliant programming language?
(a) .NET class libraries
(b) Common Language Runtime
(c) Common Language Infrastructure
(d) Component Object Model
(Ans: A) - Which of the following security features can .NET applications avail?
(a) PIN Security
(b) Code Access Security
(c) Role Based Security
(d) Authentication Security
(e) Biorhythm Security
1, 4, 5
2, 5
2, 3
3, 4
(Ans: C) - How many levels of compilation happen in the .NET Framework?
(a) One
(b) Two
(c) Three
(d) Four
(Ans: B) - For the code snippet shown below, which of the following statements are valid?
public class Generic<T> { public T Field; public void TestSub() { T i = Field + 1; } } class MyProgram { static void Main(string[] args) { Generic<int> gen = new Generic<int>(); gen.TestSub(); } }
(a) Addition will produce result 1.
(b) Result of addition is system-dependent.
(c) Program will generate run-time exception.
(d) Compiler will report an error: Operator '+' is not defined for types T and int.
(Ans: D) - What will be the output of the program?
public class SqrtExample { public static void main(String[] args) { double value = -9.0; System.out.println(Math.sqrt(value)); } }
(a) 3.0
(b) -3.0
(c) NaN
(d) Compilation fails
(Ans: C)