Bird
Raised Fist0
Postmantesting~20 mins

Collections and folders in Postman - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Postman Collections Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Postman Collection Structure

Which statement best describes the relationship between collections and folders in Postman?

AFolders are used to group requests inside a collection to organize them logically.
BCollections are subsets inside folders to separate different API endpoints.
CFolders exist outside collections and cannot be part of any collection.
DFolders and collections are the same and can be used interchangeably.
Attempts:
2 left
💡 Hint

Think about how you organize files on your computer into folders inside a main folder.

❓ Predict Output
intermediate
2:00remaining
Output of Folder Count in a Collection

Given a Postman collection JSON with 3 folders, what will be the output of the following test script counting folders?

Postman
const folderCount = pm.collection.folders.count();
console.log(folderCount);
A0
Bundefined
C3
DError: pm.collection.folders is not a function
Attempts:
2 left
💡 Hint

pm.collection.folders.count() returns the number of folders in the current collection.

❓ assertion
advanced
2:00remaining
Correct Assertion for Folder Existence

Which assertion correctly verifies that a folder named 'User APIs' exists in the current Postman collection?

Postman
const folderNames = pm.collection.folders.all().map(folder => folder.name);
Apm.test('Folder exists', () => pm.expect(folderNames).to.equal('User APIs'));
Bpm.test('Folder exists', () => pm.expect(folderNames).to.include('User APIs'));
Cpm.test('Folder exists', () => pm.expect(folderNames).to.have.property('User APIs'));
Dpm.test('Folder exists', () => pm.expect(folderNames).to.be.true);
Attempts:
2 left
💡 Hint

Check if an array includes a specific string.

🔧 Debug
advanced
2:00remaining
Debugging Folder Access Error

Why does this Postman test script throw an error: TypeError: pm.collection.folders.map is not a function?

Postman
const folderNames = pm.collection.folders.all().map(folder => folder.name);
pm.test('Check folders', () => pm.expect(folderNames.length).to.be.above(0));
Apm.collection.folders is undefined because the collection has no folders.
BThe map function is misspelled and should be maps().
CThe test script is missing a required import for map function.
Dpm.collection.folders is an object, not an array, so map() is not available.
Attempts:
2 left
💡 Hint

Check the data type of pm.collection.folders before using array methods.

❓ framework
expert
3:00remaining
Best Practice for Organizing Large API Tests in Postman

For a large API project with hundreds of requests, which approach best uses Postman collections and folders to maintain test clarity and reusability?

ACreate one collection with folders grouping requests by resource type, and use folder-level pre-request and test scripts for shared setup and assertions.
BCreate separate collections for each API endpoint without folders to keep things simple.
CPut all requests in a single folder inside one collection and duplicate pre-request scripts in each request.
DAvoid using folders; instead, use environment variables to separate requests logically.
Attempts:
2 left
💡 Hint

Think about grouping related requests and sharing setup code efficiently.

Practice

(1/5)
1. What is the main purpose of a Collection in Postman?
easy
A. To create user accounts in Postman
B. To store environment variables
C. To write JavaScript code for tests
D. To group API requests and tests together for better organization

Solution

  1. Step 1: Understand what a Collection is

    A Collection in Postman is used to group API requests and tests logically.
  2. Step 2: Differentiate from other features

    Environment variables and user accounts are separate features, not Collections.
  3. Final Answer:

    To group API requests and tests together for better organization -> Option D
  4. Quick Check:

    Collection = Group API requests [OK]
Hint: Collections group requests; folders organize inside collections [OK]
Common Mistakes:
  • Confusing collections with environments
  • Thinking collections store user data
  • Mixing collections with test scripts
2. Which of the following is the correct way to create a folder inside a Postman collection?
easy
A. Drag and drop requests outside the collection
B. Right-click the collection and select 'Add Folder'
C. Click 'New' and select 'Environment'
D. Use the 'Runner' tab to create folders

Solution

  1. Step 1: Identify folder creation method

    Folders are created by right-clicking a collection and choosing 'Add Folder'.
  2. Step 2: Eliminate incorrect options

    Creating environments or using Runner does not create folders.
  3. Final Answer:

    Right-click the collection and select 'Add Folder' -> Option B
  4. Quick Check:

    Create folder = Right-click collection [OK]
Hint: Right-click collection to add folder quickly [OK]
Common Mistakes:
  • Trying to create folders from the Runner tab
  • Confusing environments with folders
  • Dragging requests outside collections
3. Given a collection with two folders named Users and Orders, which statement is true about running tests in Postman?
medium
A. You can run all requests in the collection or just one folder at a time
B. You must run each request individually; folders cannot be run
C. Folders run automatically when you open the collection
D. Running a folder deletes all requests inside it

Solution

  1. Step 1: Understand running collections and folders

    Postman allows running all requests in a collection or just those inside a specific folder.
  2. Step 2: Verify incorrect options

    Folders do not run automatically, and running does not delete requests.
  3. Final Answer:

    You can run all requests in the collection or just one folder at a time -> Option A
  4. Quick Check:

    Run collection or folder = possible [OK]
Hint: Run entire collection or single folder as needed [OK]
Common Mistakes:
  • Believing folders run automatically
  • Thinking folders cannot be run
  • Confusing running with deleting requests
4. You created a folder inside a collection but it does not appear in the sidebar. What is the most likely cause?
medium
A. The folder was not saved properly after creation
B. Postman does not support folders inside collections
C. You need to restart Postman to see new folders
D. Folders only appear after running the collection

Solution

  1. Step 1: Check folder creation process

    If a folder does not appear, it is often because it was not saved or confirmed properly.
  2. Step 2: Exclude other causes

    Postman supports folders, no restart needed, and folders appear immediately, not after running.
  3. Final Answer:

    The folder was not saved properly after creation -> Option A
  4. Quick Check:

    Unsaved folder = not visible [OK]
Hint: Always save folder after creating to see it [OK]
Common Mistakes:
  • Assuming Postman lacks folder support
  • Restarting Postman unnecessarily
  • Expecting folders to appear only after running
5. You want to organize a large API test suite in Postman with multiple related requests. Which approach best uses collections and folders for clarity and reusability?
hard
A. Create one folder per API and put all requests directly inside it without collections
B. Put all requests in a single collection without folders to avoid complexity
C. Create one collection per API, then use folders inside it to group related requests by feature
D. Create separate collections for each request to isolate tests

Solution

  1. Step 1: Understand best organization practice

    Using one collection per API keeps tests grouped logically, and folders inside help organize by feature.
  2. Step 2: Evaluate other options

    Folders cannot exist without collections, too many collections reduce reusability, and no folders cause clutter.
  3. Final Answer:

    Create one collection per API, then use folders inside it to group related requests by feature -> Option C
  4. Quick Check:

    Collection + folders = best organization [OK]
Hint: Use collections for APIs, folders for features inside [OK]
Common Mistakes:
  • Trying to create folders without collections
  • Overusing collections for each request
  • Avoiding folders causing messy tests
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard