Quick Revision

GK One-Line Question & Answer

15541+ short questions with short answers, covering every category and sub-category on the site — no long articles to scroll through. Good for a fast recap before an exam, or a few minutes of daily practice.

Data Structures and Algorithms → Introduction to DSA 16

The output of: int x=42; const int &cr=x; x=100; cout<<cr;
100
click to copy
The output of: const int x=5; int *p=const_cast<int*>(&x); *p=10; cout<<x;
5 (modifying const is UB)
click to copy
The output of: class A{public:void f()const{cout<<"const";}void f(){cout<<"non-const";}}; const A a; a.f();
const
click to copy
The output of: class A{public:void f()const{cout<<"C";}void f(){cout<<"N";}}; A a; a.f();
N
click to copy
The output of: int arr[5]; fill(arr,arr+5,7); cout<<arr[0]<<arr[4];
77
click to copy
The output of: vector<int> v={1,2,3}; v.assign(5,0); cout<<v.size()<<v[0];
50
click to copy
The output of: list<int> l={1,2,3,4,5}; l.remove(3); cout<<l.size();
4
click to copy
The output of: list<int> l={3,1,4,1,5}; l.sort(); l.unique(); cout<<l.size();
4
click to copy
The output of: vector<int> v={1,2,3,4,5}; auto r=remove_if(v.begin(),v.end(),[](int x){return x%2==0;}); v.erase(r,v.end()); cout<<v.size();
3
click to copy
The output of: forward_list<int> fl={1,2,3}; fl.push_front(0); cout<<fl.front();
0
click to copy
forward_list vs list in C++:
forward_list is singly-linked (no backward traversal, less memory)
click to copy
The output of: auto r=views::iota(1,6)|views::transform([](int x){return x*x;})|views::take(3); for(auto x:r)cout<<x<<" ";
1 4 9
click to copy
The output of: int n=2; while(n<=100){cout<<n<<" "; n*=2;}
2 4 8 16 32 64
click to copy
The output of: int arr[]={1,2,3,4,5}; int*p=arr+2; cout<<*(p-1)<<*p<<*(p+1);
234
click to copy
The output of: string s="Hello World"; istringstream iss(s); string word; vector<string> words; while(iss>>word)words.push_back(word); cout<<words.size()<<words[0];
2Hello
click to copy
C++ is best described as which type of programming language?
Compiled, statically-typed, multi-paradigm language supporting OOP, generic, and procedural programming
click to copy

Computer Fundamentals → Generations of Computer 12

Which vacuum tube was used in first generation computers?
Triode
click to copy
First generation computers used which programming language?
Machine Language
click to copy
Which generation of computers used transistors?
Second
click to copy
Transistors replaced vacuum tubes in which computer generation?
2nd
click to copy
Which generation introduced Integrated Circuits (ICs)?
Third
click to copy
The fourth generation of computers is characterized by?
Microprocessors
click to copy
Which generation of computers introduced VLSI technology?
Fourth
click to copy
Which language was developed for second generation computers?
Assembly Language
click to copy
Which of the following is NOT a first generation computer?
IBM 360
click to copy
Which generation of computers had batch processing operating systems?
Second
click to copy
The operating speed of first generation computers was measured in?
Milliseconds
click to copy
The operating speed of fourth generation computers is measured in?
Nanoseconds
click to copy

Computer Fundamentals → Introduction to Computer 11

ENIAC stands for?
Electronic Numerical Integrator and Computer
click to copy
Fifth generation computers are based on?
Artificial Intelligence
click to copy
UNIVAC was the first commercially available computer belonging to which generation?
First
click to copy
IBM 7094 belongs to which computer generation?
Second
click to copy
The size of computers decreased significantly due to?
Use of transistors
click to copy
Time-sharing was introduced in which computer generation?
Third
click to copy
Which company developed the first microprocessor Intel 4004?
Intel
click to copy
Nanosecond speed is associated with which computer generation?
Third
click to copy
Which generation introduced multiprogramming?
Third
click to copy
Magnetic core memory was used in which generation?
Second
click to copy
Punched cards as input are associated with which generation?
First and Second
click to copy

Computer Fundamentals → Memory Units 1

PARAM is a supercomputer developed by?
India
click to copy