Loading...
Bangladesh Power Development Board(BPDB)

Post: Assistant Engineer (CSE)
Exam Date: 24-02-2023, Exam Taker: BUET
1. . What is the total number of tokens that will be generated by the logical analyzer for the C statement given below? You can designed the spaces:
Power=bpdb*(nuclear+coal+hydro)

The total number of tokens generated by the logical analyzer for the given C statement Power=bpdb*(nuclear+coal+hydro) is 11 tokens, identified as follows:

  1. Identifier: Power
  2. Assignment operator: =
  3. Identifier: bpdb
  4. Multiplication operator: *
  5. Left parenthesis: (
  6. Identifier: nuclear
  7. Addition operator: +
  8. Identifier: coal
  9. Addition operator: +
  10. Identifier: hydro
  11. Right parenthesis: )

Each part of the statement is considered a separate token, including operators, parentheses, and identifiers.

2. Write down the names of the three users who can access a file on directory on Linux.

In Linux, there are three types of users who can access a file or directory:

  1. Owner:
    The user who owns the file or directory. The owner typically has full read, write, and execute permissions by default.

  2. Group:
    A group of users who share the same access permissions for the file or directory. Permissions can be specifically assigned for read, write, and execute actions.

  3. Other:
    Any user who is neither the owner nor a member of the assigned group. These users can also be given specific permissions to read, write, or execute the file or directory.

Note: Permissions in Linux are set using the chmod command, which allows the owner, group, and others to be granted specific access to the file or directory.

3. You need to find the total number of linux of the .c and .h file in the current directory formulas the linux commands to display this ......... (Approximate)

To find the total number of .c and .h files in the current directory, you can use the following Linux command:

ls *.c *.h | wc -l

Explanation:

  1. ls *.c *.h: Lists all files in the current directory with the .c or .h extensions using wildcards (*).
  2. |: Pipes the output of the ls command to the next command.
  3. wc -l: Counts the number of lines in the output, which corresponds to the total number of .c and .h files.

This command will output the total count of .c and .h files in the current directory.

4. The maximum subarray is the task of finding a contiguous subarray with the largest sum within a given one dimentional array of numbers. Suppose the array is: A: [-2, 1, -3, -1, 2, 1, -5, 4]

To find the maximum subarray, which is a contiguous subarray with the largest sum, Kadane’s Algorithm is used. Here’s how it works for the given array A = [-2, 1, -3, 1, 2, 1, -5, 4]:

Steps:

Initialize two variables:

  • max_so_far: This keeps track of the largest sum of any subarray found so far. Set this to the first element of the array.
  • max_ending_here: This tracks the maximum sum of the subarray ending at the current position. Set this to the first element of the array.

Iterate through the array starting from the second element:

    • For each element in the array:
      • Update max_ending_here to the greater of:
        • The current element itself (indicating starting a new subarray).
        • The current element added to max_ending_here (continuing the current subarray).
      • Update max_so_far to the greater of:
        • The current max_so_far.
        • max_ending_here.

Final Result:

    • At the end of the process, max_so_far will hold the largest subarray sum.
5. Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s?
a. (0+1) *0011 (0+1)* +(0+1) *1100 (0+ 1)*
b. (0+1) *(00(0+1)*11+11(0+1)*00) (0+ 1)*
c. (0+1) *00 (0+1)* +(0+1) *11 (0 + 1)*
d. 00 (0+1) *11 + 11 (0+1) *00

The regular expression that represents the language of all binary strings containing at least two consecutive 0s and two consecutive 1s is option (b):

(0 + 1)*(00(0 + 1)*11 + 11(0 + 1)*00)(0 + 1)*

Explanation:

  1. (0 + 1)*:

    • Matches any sequence of 0s and 1s (including an empty sequence). This allows any binary string before encountering the required pattern.
  2. 00(0 + 1)*11:

    • Matches a sequence starting with two consecutive 0s, followed by any binary sequence, and ending with two consecutive 1s. This ensures the string contains at least two consecutive 0s and 1s in this specific order.
  3. 11(0 + 1)*00:

    • Matches a sequence starting with two consecutive 1s, followed by any binary sequence, and ending with two consecutive 0s. This ensures the string contains at least two consecutive 1s and 0s in this specific order.
  4. (0 + 1)*:

    • Matches any sequence of 0s and 1s after encountering the required pattern.
6. An artificial intelligence is an agent is an entity that continuosly revious its enviornment

Agent Environment in Artificial Intelligence

An agent environment in Artificial Intelligence refers to the surroundings or conditions in which an agent operates, perceives inputs, and takes actions.

  • Agent: An entity that perceives the environment through sensors and acts upon it using actuators.
  • Environment: Everything outside the agent that it interacts with.
  • Function: The environment provides inputs to the agent, and the agent responds with actions.

Types of Environment:

  • Fully Observable / Partially Observable
  • Deterministic / Stochastic
  • Static / Dynamic
  • Discrete / Continuous

Artificial Intelligence-এ Agent Environment

Agent environment হলো সেই পরিবেশ বা অবস্থা যেখানে একটি agent কাজ করে, input গ্রহণ করে এবং action নেয়।

  • Agent: একটি entity যা sensor দিয়ে environment থেকে তথ্য গ্রহণ করে এবং actuator দিয়ে কাজ করে।
  • Environment: Agent-এর বাইরে থাকা সবকিছু যার সাথে agent interaction করে।
  • Function: Environment agent-কে input দেয় এবং agent সেই অনুযায়ী action নেয়।

Environment-এর ধরন:

  • Fully Observable / Partially Observable
  • Deterministic / Stochastic
  • Static / Dynamic
  • Discrete / Continuous

You must subscribe & Login to view more.

Don’t have an account? Register

Or your subscription is under review by admin. Please message on WhatsApp / Telegram.

Leave a Comment

Latest Post
Field Based Job Question & Solution
Bank IT Job Solution

MCQ + Written from Bangladesh Bank, Sonali, Combined Bank IT recruitment.

BPSC IT Job Solution

BPSC Computer/IT cadre & non-cadre post Question papers with full solutions.

Gas Field IT Job Solution

Gas field like TGTDCL, BGDCL, JGTDSL, KGDCL, SGCL, RPGCL, GTCL etc. question solution

Power Sector IT Job Solution

Power sector such as NESCO, DESCO, DPDC, WZPDCL, BPDB, PGCB, BREB etc

Other IT Job Solution

Other Govt. Semi govt. organization like BCC, BTCL, CAAB, NSI etc.

NTRCA IT Job Solution (upcoming)

NTRCA ICT-related posts such as Assistant Teacher, Demonstrator, Lecturer.

IT MCQ Job Solution

Collected MCQ Job solution of BANK, BPSC, POWER SECTOR, GAS Field and Others.

Topic Based Q&S
WhatsApp Telegram Messenger