Frequently asked questions and answers of Agda in Programming Technologies of Computer Science to enhance your skills, knowledge on the selected topic. We have compiled the best Agda Interview question and answer, trivia quiz, mcq questions, viva question, quizzes to prepare. Download Agda FAQs in PDF form online for academic course, jobs preparations and for certification exams .
Intervew Quizz is an online portal with frequently asked interview, viva and trivia questions and answers on various subjects, topics of kids, school, engineering students, medical aspirants, business management academics and software professionals.
Question-1. How does Agda support constructive mathematics?
Answer-1: Every proof corresponds to a constructible object.
Question-2. How do you work with lists in Agda?
Answer-2: Define data List (A : Set) : Set where [] : List A; _::_ : A ? List A ? List A.
Question-3. What is an erased argument in Agda?
Answer-3: Arguments marked with @0 are erased at runtime for efficiency.
Question-4. How do you define a higher-order function in Agda?
Answer-4: By taking a function as an argument, e.g., map : (A ? B) ? List A ? List B.
Question-5. What is Agda?s role in formal verification?
Answer-5: It is used to verify mathematical proofs and software correctness.
Question-6. What are interactive proofs in Agda?
Answer-6: Step-by-step proof development using interactive editing.
Question-7. How do you handle dependent pattern matching?
Answer-7: Using pattern matching inside dependent functions.
Question-8. What is a homotopy type theory (HoTT) in Agda?
Answer-8: A framework extending type theory with higher-dimensional structures.
Question-9. How do you define a monoid in Agda?
Answer-9: Using a record, e.g., record Monoid (A : Set) : Set where field unit : A; op : A ? A ? A.
Question-10. How does Agda handle implicit conversions?
Answer-10: Using instance arguments and type inference.
Question-11. Can Agda compile to executable programs?
Answer-11: No, it is mainly for proofs, but it can generate Haskell code.
Question-12. What is {-# TERMINATING #-} used for?
Answer-12: It tells Agda to skip termination checking for a function.
Question-13. How do you use dependent pairs in Agda?
Answer-13: Using ? types or records.
Question-14. What is the role of the module system in Agda?
Answer-14: It helps structure large proofs and programs.
Question-15. How do you use interactive theorem proving in Agda?
Answer-15: By filling in terms interactively with a proof assistant.
Question-16. What is a category in Agda?
Answer-16: It represents a mathematical category with objects and morphisms.
Question-17. What are coinductive types in Agda?
Answer-17: Types that allow infinite structures like streams.
Question-18. How does Agda handle side effects?
Answer-18: Agda does not have built-in side effects, but monads can be used.
Question-19. What is {-# OPTIONS --safe #-} in Agda?
Answer-19: It ensures that only safe features of Agda are used.
Question-20. Can Agda be used for practical programming?
Answer-20: It is mainly for theorem proving, but it can model programs.
Question-21. How do you write a proof of a + b = b + a in Agda?
Answer-21: Using induction on a or b.
Question-22. Where can you learn more about Agda?
Answer-22: The official site: https://agda.readthedocs.io.
Question-23. What is Agda?
Answer-23: Agda is a dependently typed functional programming language and proof assistant.
Question-24. What makes Agda unique?
Answer-24: It features dependent types, allowing proofs and programs to be written together.
Question-25. What is the file extension for Agda source files?
Answer-25: .agda
Question-26. How do you declare a function in Agda?
Answer-26: f : Type followed by f = expression, e.g., add : Nat ? Nat ? Nat; add x y = x + y.
Question-27. What is a dependent type?
Answer-27: A type that depends on a value, enabling more precise type checking.
Question-28. How do you define a simple data type in Agda?
Answer-28: Use data, e.g., data Bool : Set where true : Bool; false : Bool.
Question-29. What is Set in Agda?
Answer-29: Set is the type of types, representing the universe of types.
Question-30. How do you define a recursive function in Agda?
Answer-30: Define a function that calls itself, e.g., fact : Nat ? Nat; fact 0 = 1; fact (suc n) = (suc n) * fact n.
Question-31. What is a proof in Agda?
Answer-31: A proof is a term that inhabits a type that represents a proposition.
Question-32. What is pattern matching in Agda?
Answer-32: It is a way to define functions by cases using constructors, e.g., not : Bool ? Bool; not true = false; not false = true.
Question-33. How does Agda handle infinite data structures?
Answer-33: It allows coinductive types using codata.
Question-34. What is the difference between Type and Set?
Answer-34: Set is used for types, while Type is not explicitly defined in Agda.
Question-35. What is an inductive type in Agda?
Answer-35: A type defined by cases, e.g., data Nat : Set where zero : Nat; suc : Nat ? Nat.
Question-36. How does Agda support theorem proving?
Answer-36: By writing dependent types that encode logical statements and constructing values to prove them.
Question-37. What is a sigma type in Agda?
Answer-37: A dependent pair type, written as ? A B or {x : A} ? B x.
Question-38. What is a pi type in Agda?
Answer-38: A dependent function type, written as (x : A) ? B x.
Question-39. What is implicit argument notation in Agda?
Answer-39: Arguments wrapped in curly braces {} are inferred automatically.
Question-40. How do you define a module in Agda?
Answer-40: Use module Name where, followed by definitions.
Question-41. How do you import a module in Agda?
Answer-41: Use open import ModuleName.
Question-42. What are universe levels in Agda?
Answer-42: Set is indexed as Set0, Set1, ... to prevent paradoxes.
Question-43. What is an Agda record?
Answer-43: A structure that groups related values, e.g., record Point : Set where field x y : Nat.
Question-44. What is termination checking in Agda?
Answer-44: Agda ensures recursive functions terminate to maintain soundness.
Question-45. What is totality in Agda?
Answer-45: Every function must be defined for all possible inputs without infinite recursion.
Question-46. How does Agda prevent infinite loops?
Answer-46: By enforcing termination checks on recursive functions.
Question-47. What is a parameterized data type in Agda?
Answer-47: A data type that takes parameters, e.g., data Vec (A : Set) : Nat ? Set where.
Question-48. How do you define equality in Agda?
Answer-48: Using data _?_ {A : Set} (x : A) : A ? Set where refl : x ? x.
Question-49. What is the Curry-Howard correspondence?
Answer-49: It relates types to propositions and programs to proofs.
Question-50. How do you prove an equality statement in Agda?
Answer-50: By constructing a value of type x ? y, usually using refl.
Frequently Asked Question and Answer on Agda
Agda Interview Questions and Answers in PDF form Online
Agda Questions with Answers
Agda Trivia MCQ Quiz