DESCO Assistant Engineer Exam 2016 — Question Solution | ডেসকো সহকারী প্রকৌশলী নিয়োগ পরীক্ষা ২০১৬ — প্রশ্ন সমাধান
- DESCO
- Assistant Engineer
- 2016
- 11 questions · 0 MCQ, 11 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The DESCO Assistant Engineer exam was held in 2016. The paper had 11 written questions. The subjects asked most were Database (5), Programming (4) and Digital Logic (1). This page lists every question, with 1 answered and explained; the rest of the answers open with a free ARBS Academy account, where the paper can also be practised as a timed test.
ডেসকো সহকারী প্রকৌশলী নিয়োগ পরীক্ষার (২০১৬) এই প্রশ্নপত্রে ১১টি প্রশ্ন ছিল, বেশিরভাগ ডেটাবেজ ও প্রোগ্রামিং থেকে। এখানে ১টি প্রশ্নের ব্যাখ্যাসহ উত্তর দেওয়া আছে; বাকিগুলো ফ্রি অ্যাকাউন্টে খোলে।
- Organisation
- DESCO
- Post
- Assistant Engineer
- Exam date
- 2016
- Questions
- 11 (0 MCQ, 11 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
Which join should be used when there is no match between two tables?
Which modifier should be used to remove duplicate rows in SQL query?
Write a program in any language to find out maximum among three numbers.
What does the following query do?
SELECT * FROM students ORDER BY ID, NAME DESC
What is the purpose of index in database?
Sign up free to see the model answers to written questions 1–5 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
How hashtable is used in database?
Model answer
Answer: a database uses a hash table to find data by computing its location from the key instead of searching. A hash function h(key) maps the search key to a bucket (a disk block or a slot in memory). The record, or its index entry, is stored in that bucket, so an equality lookup usually needs one bucket access, O(1) on average. A B+-tree needs O(log n) node visits.
flowchart LR
K["search key: 1022"] --> H["h(k) = k mod 5"]
H --> B["bucket 2"]
B --> O["overflow block of bucket 2"]
O --> REC["record 1022"]
Where a DBMS uses hashing
| Use | How the hash table is used |
|---|---|
| Hash file organisation (static hashing) | Records are placed in bucket h(key); a full bucket gets chained overflow blocks |
| Hash index | Buckets hold (key, row-pointer) entries. PostgreSQL: CREATE INDEX … USING HASH (col), used only for =. MySQL: HASH indexes on the MEMORY (and NDB) engine; InnoDB supports only BTREE and builds a B-tree if USING HASH is written |
| Hash join | For an equi-join, the DBMS builds an in-memory hash table on the join key of the smaller input, then probes it with each row of the other input. Used by PostgreSQL, Oracle, SQL Server, and MySQL from 8.0.18 |
| Hash aggregation | GROUP BY / DISTINCT can be computed by hashing each group key into a table of running totals |
| Hash partitioning | Rows are spread over partitions or shards by h(partition key) (e.g. PARTITION BY HASH), which balances load |
Worked example, static hashing: h(k) = k mod 5, 5 buckets, 2 records per bucket, overflow chained.
| Key | k mod 5 | Stored in |
|---|---|---|
| 1007 | 2 | bucket 2 |
| 1012 | 2 | bucket 2 (now full) |
| 1022 | 2 | overflow of bucket 2 |
| 1031 | 1 | bucket 1 |
| 1045 | 0 | bucket 0 |
| 1053 | 3 | bucket 3 |
| 1060 | 0 | bucket 0 |
| 1017 | 2 | overflow of bucket 2 |
- Lookup 1022: compute 1022 mod 5 = 2, read bucket 2 (not there), then its overflow block, where it is found: 2 block reads.
- Lookup 1099: 1099 mod 5 = 4, bucket 4 is empty, so "not found" after 1 read. The rest of the table is never scanned.
- Bucket 4 is empty while bucket 2 overflows. This bucket skew is why a good hash function and dynamic hashing (extendible or linear hashing, which split buckets as the data grows) are used.
Worked example, hash join: department(10 Admin, 20 ICT) is hashed on dept_id. Probing with employees (Shila 20, Raju 10, Babu 30, Nila 20) gives Shila–ICT, Raju–Admin, Nila–ICT. Babu finds no entry and is dropped, as in an inner join.
Hash index vs B+-tree index
| Point | Hash | B+-tree |
|---|---|---|
WHERE id = 1022 |
Best, about 1 bucket access | Good, O(log n) |
BETWEEN, <, >, LIKE 'ab%' |
Not supported (order is scrambled) | Supported |
ORDER BY without a sort |
No | Yes (leaves are in key order) |
| Growth | Static hashing needs rehashing; dynamic hashing splits buckets | Splits and merges nodes automatically |
Exam tip: write "address = h(key)" with a mod-hash example, list hash index, hash join and hash partitioning, and state that hashing serves equality lookups but not range queries.
Trouth table construction for f(A,B,C,D) = (A+B) ⊕ (CD)
Write output:
#include<stdio.h>
#define max(a,b) (a>b?a:b)
int main(){
int i=1,j=2,k=0;
k=max(i++,++j);
printf("%d",k);
return 0;
}
Draw a high level use case diagram: Use case diagram for a visitor who wants to log in to a page using a username and password.
Write output:
#include <stdio.h>
int sum(int i){
static int total=0;
total+=i;
return total;
}
int main(){
int i;
for(i=1; i<10; i++){
printf("%d ", sum(i));
}
}
In java language: write a class named Bicycle having 3 integer variables (speed, gear, cost) and a constructor to initialize the variables. Also write a class named MountBike that inherits Bicycle class, having an extra variable speedcost and a constructor to initialize the variable.
Sign up free to see the model answers to written questions 7–11 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
10 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ১০টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 6 syllabus chapters; Language Basics & Syntax and ER Model & Design lead, with 3 each. Language Basics & Syntax is asked in 122 other papers too (2015–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- Language Basics & Syntax Programming · 122 other papers, 2015–20263
- ER Model & Design Database · 101 other papers, 2015–20263
- Indexing & Storage Database · 8 other papers, 2018–20252
- Control Flow & Loops Programming · 76 other papers, 2015–20261
- Boolean Algebra & K-Maps Digital Logic · 50 other papers, 2016–20261
- Requirements & Design Software Engineering · 50 other papers, 2017–20261
From our own past papers: each question filed under one syllabus chapter. Practice and held questions are not counted.
Questions about this paper · সাধারণ প্রশ্ন
- How many questions were in the DESCO Assistant Engineer exam (2016)?
- 11 written questions.
- Which subjects were asked most in the DESCO Assistant Engineer exam (2016)?
- Database (5), Programming (4) and Digital Logic (1), out of 11 questions.
- When was the DESCO Assistant Engineer exam held?
- In 2016. The exact day isn't in our records.
- Where can I find the DESCO Assistant Engineer exam (2016) question solution?
- On this page: 1 of the 11 questions are shown with worked answers. The rest of the answers open with a free ARBS Academy account, where the paper can also be practised as a timed test.
Question text is from the public recruitment exam; answers and explanations are written by ARBS Academy. All past papers