Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

Multiple choice question for engineering

Set 1

1. Which among the following is odd one out?
a) printf
b) fprintf
c) putchar
d) scanf

View Answer

Answer: d

2. For a typical program, the input is taken using
a) scanf
b) Files
c) Command-line
d) All of the mentioned

View Answer

Answer: d

3. What does the following command line signify?
    prog1|prog2
a) It runs prog1 first, prog2 second
b) It runs prog2 first, prog1 second
c) It runs both the programs, pipes output of prog1 to input of prog2
d) It runs both the programs, pipes output of prog2 to input of prog1

View Answer

Answer: c

4. What is the default return-type of getchar()?
a) char
b) int
C. char *
D. reading character doesn’t require a return-type

View Answer

Answer: b

5. The value of EOF is_____
a) -1
b) 0
c) 1
d) 10

View Answer

Answer: a

6. What is the use of getchar()?
a) The next input character each time it is called
b) EOF when it encounters end of file
c) The next input character each time it is called
EOF when it encounters end of file
d) None of the mentioned

View Answer

Answer: c

7. Which is true?
a) The symbolic constant EOF is defined in <stdio.h>
b) The value is -1
c) The symbolic constant EOF is defined in <stdio.h> & value is -1
d) Only value is -1

View Answer

Answer: c

8. What is the return value of putchar()?
a) The character written
b) EOF if an error occurs
c) Nothing
d) Both character written & EOF if an error occurs

View Answer

Answer: d

Set 2

1. What is the sequence for preprocessor to look for the file within <> ?
a) The predefined location then the current directory
b) The current directory then the predefined location
c) The predefined location only
d) The current directory location

View Answer

Answer: a [Reason:] <> first searches the predefined location for the specified file and then the current directory.

2. Which directory the compiler first looks for the file when using #include ?
a) Current directory where program is saved
b) C:COMPILERINCLUDE
c) S:SOURCEHEADERS
d) Both C:COMPILERINCLUDE and S:SOURCEHEADERS simultaneously

View Answer

Answer: b [Reason:] The order of file look up is in the sequence of option b, c, a.

3. What would happen if you create a file stdio.h and use #include “stdio.h” ?
a) The predefined library file will be selected
b) The user-defined library file will be selected
c) Both the files will be included
d) The compiler won’t accept the program

View Answer

Answer: b

4. How is search done in #include and #include “somelibrary.h” according to C standard?
a) When former is used, current directory is searched and when latter is used, standard directory is searched
b) When former is used, standard directory is searched and when latter is used, current directory is searched
c) When former is used, search is done in implementation defined manner and when latter is used, current directory is searched
d) For both, search for ‘somelibrary’ is done in implementation-defined places

View Answer

Answer: d

5. How is search done in #include and #include”somelibrary.h” normally or conventionally?
a) When former is used, current directory is searched and when latter is used, standard directory is searched
b) When former is used, predefined directory is searched and when latter is used, current directory is searched and then predefined directories are searched
c) When former is used, search is done in implementation defined manner and latter is used to search current directory
d) For both, search for somelibrary is done in implementation-defined manner

View Answer

Answer: b

6. Can function definition be present in header files?
a) Yes
b) No
c) Depends on the compiler
d) Depends on the standard

View Answer

Answer: a

7. Comment on the output of this C code?

  1.     #include <stdio.h>
  2.     #include "test.h"
  3.     #include "test.h"
  4.     int main()
  5.     {
  6.         //some code
  7.     }

a) True
b) Compile time error
c) False
d) Depends on the compiler

View Answer

Answer: b

8. What is the output of this C code?

  1.     #include <stdio.h>
  2.     #define foo(m, n) m ## n
  3.     void myfunc();
  4.     int main()
  5.     {
  6.         myfunc();
  7.     }
  8.     void myfunc()
  9.     {
  10.         printf("%dn", foo(2, 3));
  11.     }

a) 23
b) 2 3
c) Compile time error
d) Undefined behaviour

View Answer

Answer: a

Set 3

1. Which of the following function can be replaced with the question mark in the below figure ?
data-science-questions-answers-introduction-regression-models-q1
a) boxplot
b) lplot
c) levelplot
d) all of the Mentioned

View Answer

Answer: c [Reason:] levelplot is used plotting “image”.

2. Point out the correct statement:
a) The mean is a measure of central tendency of the data
b) Empirical mean is related to “centering” the random variables
c) The empirical standard deviation is a measure of spread
d) All of the Mentioned

View Answer

Answer: d [Reason:] The process of centering then scaling the data is called “normalizing” the data.

3. Which of the following implies no relationship with respect to correlation ?
a) Cor(X, Y) = 1
b) Cor(X, Y) = 0
c) Cor(X, Y) = 2
d) All of the Mentioned

View Answer

Answer: b [Reason:] Correlation is a statistical technique that can show whether and how strongly pairs of variables are related.

4. Normalized data are centered at ___ and have units equal to standard deviations of the original data.
a) 0
b) 5
c) 1
d) 10

View Answer

Answer: a [Reason:] In statistics and applications of statistics, normalization can have a range of meanings.

5. Point out the wrong statement:
a) Regression through the origin yields an equivalent slope if you center the data first
b) Normalizing variables results in the slope being the correlation
c) Least squares is not an estimation tool
d) None of the Mentioned

View Answer

Answer: c [Reason:] Least squares is an estimation tool.

6. Which of the following is correct with respect to residuals ?
a) Positive residuals are above the line, negative residuals are below
b) Positive residuals are below the line, negative residuals are above
c) Positive residuals and negative residuals are below the line
d) All of the Mentioned

View Answer

Answer: a [Reason:] Residuals can be thought of as the outcome with the linear association of the predictor removed.

7. Minimizing the likelihood is the same as maximizing -2 log likelihood.
a) True
b) False

View Answer

Answer: a [Reason:] Maximizing the likelihood is the same as minimizing 2 log likelihood.

8. Which of the following refers to the circumstance in which the variability of a variable is unequal across the range of values of a second variable that predicts it ?
a) Heterogenity
b) Heteroskedasticity
c) Heteroelasticty
d) None of the Mentioned

View Answer

Answer: b [Reason:] Heteroskedasticity has serious consequences for the OLS estimator.

9. Which of the following outcome is odd man out in the below figure ?
data-science-questions-answers-introduction-regression-models-q9
a) R Squared
b) Kappa
c) RMSE
d) All of the Mentioned

View Answer

Answer: b [Reason:] Kappa is categorical outcome.

10. Residuals are useful for investigating best model fit.
a) True
b) False

View Answer

Answer: b [Reason:] Residuals are useful for investigating poor model fit.

Set 4

1. Which algorithm is based on Jackson’s rule?
a) EDD
b) LL
c) EDF
d) LST

View Answer

Answer: a [Reason:] The EDD or earliest due date is based on Jackson’s rule. The Jackson’s rule states that for a given a set of n independent tasks, any algorithm that executes the tasks in the order of nondecreasing deadlines is optimal with respect to reducing the maximum lateness. EDF is the earliest deadline first, LL is the least laxity and the LST is the least slack time first.

2. What does EDD stand for?
a) earliest device date
b) earliest due date
c) earliest device deadline
d) earliest deadline device

View Answer

Answer: b [Reason:] The earliest due date requires all tasks to be sorted by their deadlines and it is based on Jackson’s rule. If the deadlines are known, EDD algorithm can be used.

3. Which of the following can be implemented as static scheduling algorithm?
a) EDF
b) LL
c) EDD
d) LST

View Answer

Answer: c [Reason:] The EDD can be implemented as static scheduling algorithm if the deadlines are known in advance and it follows Jackson’s rule.

4. What does EDF stand for?
a) earliest deadline fix
b) earliest due fix
c) earliest due first
d) earliest deadline first

View Answer

Answer: d [Reason:] The EDF stands for earliest deadline first. This algorithm is optimal with respect to minimizing the maximum lateness and is implemented as dynamic scheduling algorithm for a set of n independent tasks with arbitrary arrival times, any algorithm that at any instant executes the task with the earliest absolute deadline among all the ready tasks is optimal with respect to minimizing the maximum lateness.

5. Which algorithm is dynamic scheduling algorithm?
a) LL
b) LST
c) EDF
d) EDD

View Answer

Answer: c [Reason:] The EDF or earliest deadline first can be implemented as a dynamic scheduling algorithm.

6. In which scheduling, the task priorities are a monotonically decreasing function of laxity?
a) LL
b) EDD
c) EFD
d) LST

View Answer

Answer: a [Reason:] In the least laxity algorithm, the laxity can be changed dynamically which shows that the task priorities are a monotonically decreasing function of laxity.

7. Which scheduling algorithm is an optimal scheduling policy for mono-processor system?
a) preemptive algorithm
b) LST
c) EDD
d) LL

View Answer

Answer: d [Reason:] The least laxity algorithm is a dynamic scheduling algorithm and hence it can be implemented as an optimal scheduling policy for the mono-processor system. The LL scheduling algorithm is also a preemptive scheduling.

8. Which scheduling algorithm cannot be used with a standard OS providing fixed priorities?
a) LL
b) LST
c) EDD
d) EFD

View Answer

Answer: a [Reason:] The least laxity algorithm cannot be used with a standard OS providing fixed priorities because of its dynamic property.

9. Who proposed LDF algorithm?
a) Bayes
b) Nyquist
c) Lawler
d) Stankovic

View Answer

Answer: c [Reason:] The latest deadline first or LDF is proposed by Lawler which performs a topological sort. It is based on the total order compatible with the partial order with respect to the task graph.

10. What does LDF stand for?
a) last deadline first
b) least deadline first
c) list deadline first
d) latest deadline first

View Answer

Answer: d [Reason:] The LDF or latest deadline first is a scheduling algorithm which is proposed by Lawler.

11. Which algorithm is non-preemptive and can be used with a mono processor?
a) LDF
b) pre-emptive
c) aperiodic
d) LL

View Answer

Answer: a [Reason:] The latest deadline first or LDF is a non-preemptive scheduling algorithm and can be used with a mono processor whereas LL or least laxity is a preemptive scheduling algorithm.

12. Which algorithm requires the periodic checks of the laxity?
a) LST
b) LL
c) EDD
d) EFD

View Answer

Answer: b [Reason:] The LL scheduling algorithm requires the knowledge of the execution times and the periodic check of the laxity.

13. Who developed the heuristic algorithm?
a) Stankovic and Ramamritham
b) Stankovic and Lawler
c) Lawler
d) Stankovic

View Answer

Answer: a [Reason:] The heuristic algorithm is developed by Stankovic and Ramamritham in 1991.

14. Which algorithm can be used if the preemptive is not allowed?
a) heuristic algorithm
b) LL
c) EDD
d) LST

View Answer

Answer: a [Reason:] The heuristic algorithm was proposed by Stankovic and Ramamritham in 1991 can be used if the preemption is not allowed.

15. Deadline interval – execution time =
a) laxity
b) execution time
c) deadline interval
d) period

View Answer

Answer: a [Reason:] The laxity is defined as the deadline interval minus the execution time. It is also known as the slack.

Set 5

1. Which of these is an area for temporary memory storage?
a) buffer
b) register
c) table
d) flag

View Answer

Answer: a [Reason:] The buffer is an area that is used to store data temporarily which can be used to compensate the timing problems.

2. Which of the following can be used a collection point of data?
a) register
b) buffer
c) flag register
d) accumulator

View Answer

Answer: b [Reason:] The buffer can be used as a collection point for data, that is all the important information can be collected and organised before processing.

3. Which device can compensate the timing problems between the software?
a) index
b) register
c) buffer
d) memory

View Answer

Answer: c [Reason:] The buffer is used to store data temporarily which can be used to compensate the timing problems between the software and it can also be used as a collection point for data, that is all the important information can be collected and organised before processing.

4. What do a buffer consist of?
a) memory and register
b) memory and peripheral
c) memory and flag register
d) memory and pointer

View Answer

Answer: d [Reason:] The buffer consist of a pointer and memory which can be used to locate the next piece of data to be removed or accessed from the buffer.

5. Which of the following is a condition for buffer overrun?
a) cannot accept data
b) cannot receive data
c) cannot provide data
d) can provide data

View Answer

Answer: a [Reason:] The buffer involves two conditions. These are the buffer overrun condition and the buffer underrun condition. If the buffer cannot accept any more data, it is said to be buffer overrun.

6. What is the state of the buffer if it asked for data and cannot provide it?
a) overrun
b) underrun
c) remains unchanged
d) beyond overrun

View Answer

Answer: b [Reason:] The buffer is said to be overrun if the buffer cannot accept any more data and said to be underrun if it asked for data but not able to provide it.

7. Which of the following can remove data from the buffer?
a) memory
b) ram
c) pointer
d) slack

View Answer

Answer: c [Reason:] The data can be removed from the buffer using a pointer. The pointer locates the next value and can move the data from the buffer and is moved to the next location by incrementing its value by the number of words or bytes.

8. How many bit does a 32-bit processor can access?
a) 32-bit char
b) 32-bit word
c) 32-bit double
d) 32-bit double word

View Answer

Answer: b [Reason:] The 32-bit processor can access 32-bit word and hence the pointer is incremented by one.

9. What occurs first if data is stored in the buffer?
a) speed increases
b) linear shoot
c) overshoot
d) delay

View Answer

Answer: d [Reason:] When the data is stored in the buffer, at first there will be a delay and the subsequent data is received from the buffer. This delay is known as buffer latency.

10. Which of the following defines the earliest information that is passed through the buffer?
a) buffer latency
b) memory
c) pointer
d) peripheral

View Answer

Answer: a [Reason:] The buffer latency determines the earliest information that passes through the buffer and any response to that information will be delayed by the buffer latency irrespective of how fast the processor is.

11. Which of the following possesses a problem for data streams on the real-time operating system?
a) pointer
b) memory
c) latency
d) processor

View Answer

Answer: c [Reason:] The latency will be a problem for the real-time operating system such as the digital audio system which must have a consistent and regular stream of data.

12. Which of the following determines the time to take a simple sample?
a) buffer
b) latency
c) pointer
d) memory

View Answer

Answer: b [Reason:] The sampling is performed on a regular basis in which the filtering takes less time than the interval between the sample and this does not need a buffering and it will have a very low latency. Each sample is received, processed and stored and the latency is the time take a single sample.

13. How is a stack created?
a) slack and pointer
b) stack and memory
c) memory and a pointer
d) memory and a register

View Answer

Answer: d [Reason:] The slack is created in the same way as the buffer does, that is by using a memory and a pointer. The control associated with the buffer or memory is a register which acts as an address pointer.

14. Which of the following acts as an address pointer?
a) memory
b) pointer
c) stack
d) register

View Answer

Answer: d [Reason:] The control associated with the buffer or memory is a register which acts as an address pointer.

15. Which of the following possesses an issue while concerning the memory size of the buffer?
a) digital signal processor
b) microprocessor
c) memory
d) pointer

View Answer

Answer: a [Reason:] The digital signal processor with on-chip memory and the microcontroller possesses an issue on concerning the memory size of the buffer with small amounts of RAM. But with the large system, this is not a major issue.

.woocommerce-message { background-color: #98C391 !important; }