InterviewPitch

Land the job you want — prepare
with Real interviews Q&A

Curated interview questions, company-wise guides and coding rounds. Practice mock interviews, improve with feedback, and track your progress.

Q&A
Top curated interview packs
Company-wise & role-wise packs, quality assured.
Mock interview
AI scoring
Coding rounds
Top 10 sets
Beginner
1. What is Prolog?
Prolog is a logic programming language based on formal logic and used mainly in AI and computational linguistics.
Beginner
2. What does Prolog stand for?
Prolog stands for Programming in Logic.
Beginner
3. What are facts in Prolog?
Facts are basic assertions about objects or relationships.parent(john, mary).
Beginner
4. What are rules in Prolog?
Rules define relationships using logical conditions.grandparent(X,Y) :- parent(X,Z), parent(Z,Y).
Beginner
5. What is a query?
A query asks Prolog to evaluate a goal.?- parent(john, mary).
Beginner
6. What is a predicate?
A predicate defines a relation between objects.
Beginner
7. What is unification?
Unification matches variables with values to satisfy goals.
Beginner
8. What is backtracking?
Prolog’s mechanism to find alternative solutions by reverting to previous states.
Beginner
9. What are variables in Prolog?
Variables start with uppercase letters or underscore.X, Person, _Value
Beginner
10. What are atoms?
Atoms are constants written in lowercase.
Beginner
11. What are lists?
Lists are ordered collections.[a,b,c]
Beginner
12. What is head and tail in list?
[H|T] where H is first element and T is remaining list.
Beginner
13. What is recursion in Prolog?
A rule calling itself to solve smaller instances.
Beginner
14. What is the cut operator?
The ! operator stops backtracking beyond that point.
Beginner
15. What is fail predicate?
fail always fails and forces backtracking.
Intermediate
16. What is anonymous variable?
The underscore (_) represents a variable whose value is ignored.
Intermediate
17. Difference between = and is?
= checks unification.is evaluates arithmetic expressions.
Intermediate
18. How is arithmetic done?
X is 5 + 3.
Intermediate
19. What is dynamic predicate?
Declared using :- dynamic predicate/arity.
Intermediate
20. What is assert?
Adds a fact or rule dynamically.
Intermediate
21. What is retract?
Removes a fact or rule dynamically.
Intermediate
22. What is member predicate?
Checks if element exists in list.member(X, [1,2,3]).
Intermediate
23. What is append predicate?
Concatenates lists.append([1,2],[3],X).
Intermediate
24. What is findall?
Collects all solutions into a list.
Intermediate
25. What is bagof?
Collects solutions considering variable bindings.
Intermediate
26. What is setof?
Similar to bagof but removes duplicates and sorts.
Intermediate
27. What is negation?
Written as \+ to mean "not provable".
Intermediate
28. What is DCG?
Definite Clause Grammar used for parsing.
Intermediate
29. What is tail recursion?
Recursion where recursive call is last operation.
Intermediate
30. What is meta-programming?
Writing programs that manipulate other programs.
Advanced
36. What is resolution in Prolog?
A rule of inference used to derive conclusions.
Advanced
37. What is SLD resolution?
Selective Linear Definite clause resolution used by Prolog.
Advanced
38. What is logical variable?
A variable that can be unified multiple times consistently.
Advanced
39. What is occurs check?
Prevents infinite recursive unification.
Advanced
40. What are constraints in Prolog?
Logical conditions restricting variable domains.
Coding Round
46. Factorial in Prolog
Answer Here
Coding Round
47. Check member in list
Answer Here
Coding Round
48. Length of list
Answer Here
Coding Round
49. Reverse list
Answer Here
Coding Round
50. Append two lists
Answer Here