Indian Institute of Technology Guwahati

CS 331 — Lab Exam Prep Guide

Programming Languages: Prolog, Java, Haskell
Session 3: 8 April 2026, 09:30–11:30 AM Total: 50 Marks Platform: DOMjudge Target: 35+
P 15 Marks J 15 Marks H 10 Marks V 10 Marks

Assignment Guides

1
Exam Architecture & Strategy
Know the battlefield before you fight

Marks Breakdown

15
Prolog
Predicate given, write logic
15
Java
Template given, fill in code
10
Haskell
Test case given, write def
10
Viva
Oral questions
Target 35+ → Aim for Prolog 12 + Java 10 + Haskell 7 + Viva 6. You do NOT need perfection on any section.

Time Allocation During Exam (120 min)

SectionTimeStrategy
Prolog45 minStart here — most marks, most practice
Java40 minTemplate fill-in — pattern-match from A4
Haskell25 minShort functions — most are 1-3 lines
Review10 minCheck output format, re-submit if needed

DOMjudge Survival Tips

Critical Rules
  • Submit source code only — never compiled binaries
  • Read from stdin, write to stdout only — no file I/O
  • For Java: NO package declaration. Class must be Main
  • Output must match exactly (whitespace, newlines, case)
  • Check verdict after each submit: Correct / Compile Error / Wrong Answer / Run Error / TLE
  • Use Clarification button for ambiguity, don't ask verbally
  • Make a test submission early to verify your setup
2
Study Schedule — April 7
Full-day crash course, optimized for 35+ marks
07:00–07:30
SETUP Read this page (Strategy + Schedule). Coffee.
07:30–09:30
PROLOG Crash Course — Syntax, equals, lists, recursion, backtracking
09:30–10:00
BREAK + read Prolog viva cards
10:00–12:00
PROLOG Advanced — Cut, negation, graph traversal, N-Queens
12:00–12:30
PROLOG Practice — Solve all 3 practice problems
12:30–13:30
LUNCH + read Java viva cards
13:30–15:30
JAVA Crash Course — Syntax, threads, synchronized/wait/notify, queues
15:30–16:00
BREAK
16:00–17:30
JAVA Patterns + Practice — volatile, state machines, ExecutorService, practice
17:30–19:30
HASKELL Full Course — Syntax, ADTs, recursion, all MinHeap functions
19:30–20:00
DINNER
20:00–20:30
HASKELL Practice — Write all 12 functions from scratch
20:30–21:30
VIVA Full Review — All 30 Q&As, say answers aloud
21:30–22:00
FINAL Read Reference Cards + Exam Checklist
22:00
SLEEP Minimum 7.5 hours before 9:30 AM exam
CS 331 — Programming Languages Lab — IIT Guwahati
Good luck on April 8. You've got this.