Computer Science — HSSC-Punjab First Year

This course has 9 chapters with 11,471 multiple-choice questions. Each question is tied to a topic from the chapter and comes with the correct answer and an explanation. Open a chapter to see its topics and a free sample of its questions, or read the sample from the whole book below.

Sample questions from the Computer Science book

10 sample questions with the correct answer and an explanation. Try to answer each one before reading the explanation.

Q1. Approving the idea of a school app and appointing the project manager. In which phase of a project management plan does this happen?

  • A. Initiation(correct answer)
  • B. Execution
  • C. Performance monitoring
  • D. Planning

Answer: A.Starting the project, deciding it is worthwhile and authorising it is the initiation phase (standard project management knowledge for the phase names listed in the figure).

Q2. Deciding whether the project is worth starting and who will lead it. In which phase of a project management plan does this happen?

  • A. Performance monitoring
  • B. Planning
  • C. Project closure
  • D. Initiation(correct answer)

Answer: D.Starting the project, deciding it is worthwhile and authorising it is the initiation phase (standard project management knowledge for the phase names listed in the figure).

Q3. for i in range(3):     for j in range(2):         print(i, j) Which output does the snippet above produce? (Each option lists the printed lines in order.)

  • A. 0 0, 1 0, 0 1, 1 1, 0 2, 1 2
  • B. 0 0, 1 0, 2 0
  • C. 0 0, 0 1, 0 2, 1 0, 1 1, 1 2
  • D. 0 0, 0 1, 1 0, 1 1, 2 0, 2 1(correct answer)

Answer: D.break leaves the loop, continue skips to the next round, and nested loops multiply their counts; the output is 0 0, 0 1, 1 0, 1 1, 2 0, 2 1 (standard knowledge).

Q4. A tree has root 0; node 0 has children 1, 2 and 3; node 1 has children 4 and 5; node 2 has child 6; node 3 has child 7. A stack-based DFS pops a node and pushes its unvisited children in ascending order (so the largest child is popped first). What is the visiting order?

  • A. 4, 5, 1, 6, 2, 7, 3, 0
  • B. 0, 3, 7, 2, 6, 1, 5, 4(correct answer)
  • C. 0, 1, 4, 5, 2, 6, 3, 7
  • D. 0, 1, 2, 3, 4, 5, 6, 7

Answer: B.The stack pops 3 first, then 7, then 2, 6, then 1, 5, 4: this order differs from the book's DFS output because the children are pushed in ascending order.

Q5. push white plate, push glass plate, push red plate, push green plate, push blue plate, pop, push steel plate, pop, pop: these operations run on an empty stack and each popped value is printed. In what order are the values printed?

  • A. ['blue plate', 'steel plate', 'red plate']
  • B. ['white plate', 'glass plate', 'red plate']
  • C. ['blue plate', 'steel plate', 'green plate'](correct answer)
  • D. ['green plate', 'steel plate', 'blue plate']

Answer: C.Every pop returns the current top item: push white plate gives ['white plate']; push glass plate gives ['white plate', 'glass plate']; push red plate gives ['white plate', 'glass plate', 'red plate']; push green plate gives ['white plate', 'glass plate', 'red plate', 'green plate']; push blue plate gives ['white plate', 'glass plate', 'red plate', 'green plate', 'blue plate']; pop removes blue plate and leaves ['white plate', 'glass plate', 'red plate', 'green plate']; push steel plate gives ['white plate', 'glass plate', 'red plate', 'green plate', 'steel plate']; pop removes steel plate and leaves ['white plate', 'glass plate', 'red plate', 'green plate']; pop removes green plate and leaves ['white plate', 'glass plate', 'red plate'].

Q6. Class A scored 66, 42, 60, 41, 51 and Class B scored 59, 37, 86, 84, 44. What are the population variances of A and B?

  • A. Class A: 96.4, Class B: 403.6(correct answer)
  • B. Class A: 9.82, Class B: 20.09
  • C. Class A: 120.5, Class B: 504.5
  • D. Class A: 403.6, Class B: 96.4

Answer: A.Class A mean 52 gives variance 96.4; Class B mean 62 gives variance 403.6. The sample variance (divide by N-1) and standard deviation are different quantities.

Q7. A fixed setup keeps 8 servers for 5 hours at 20 rupees per server-hour. An elastic setup uses 8 servers for 1 hour and 2 servers for 4 hours. How many rupees does elasticity save?

  • A. 160
  • B. 480(correct answer)
  • C. 800
  • D. 320

Answer: B.Fixed cost is 8 times 5 times 20 equals 800 rupees; elastic uses 8 plus 8 equals 16 server-hours, which is 320 rupees; the saving is 480 rupees.

Q8. Which of the following is NOT one of the common clauses described for Terms of Use?

  • A. Product advertising(correct answer)
  • B. User obligations
  • C. Termination of service
  • D. Privacy and data use

Answer: A.The common clauses are user obligations, limitations of liability, privacy and data use, intellectual property rights and termination of service; product advertising is not among them.

Q9. Which types of online research are focused on a PURPOSE for learning or education rather than for business?

  • A. Academic research and general information research(correct answer)
  • B. Market research and health research
  • C. Market research and fact-checking research for business customers
  • D. Fact-checking research and market research

Answer: A.Academic research is for educational purposes and general information research gives general knowledge, while market research serves business decisions.

Q10. Which statement best explains why entrepreneurship matters in the modern economy?

  • A. It guarantees that every new business earns a profit quickly
  • B. It replaces the need for banks, investors and customers
  • C. It turns ideas into businesses that meet needs and give people work(correct answer)
  • D. It is mainly useful for people who study technology only

Answer: C.The unit stresses the significance of entrepreneurship in the modern economy: ideas become products and services that serve customers (and, as standard knowledge, create jobs).

Practice the full Computer Science question bank

Choose a chapter or topic, take timed or instant-feedback practice exams and see which topics need more work.

Create a free account
An unhandled error has occurred. Reload 🗙