MCQs / Computer Science / Supabase: Cloud Data Tier for Android

Supabase: Cloud Data Tier for Android MCQs — Computer Science

35 multiple-choice questions on Supabase: Cloud Data Tier for Android from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.

1. Which HTTP method updates some fields of existing rows?

  1. GET
  2. HEAD
  3. OPTIONS
  4. PATCH

Answer: D) PATCH

Explanation: PATCH /table?filter with the changed fields.

Discuss this question

2. The role used for requests made without a signed-in user is:

  1. servicerole
  2. anon
  3. authenticated
  4. postgres

Answer: B) anon

Explanation: Requests with only the publishable key run as anon.

Discuss this question

3. In a three-tier mobile app, the Supabase database belongs to the:

  1. Network tier only
  2. Hardware tier
  3. Data tier
  4. Presentation tier

Answer: C) Data tier

Explanation: Presentation = app UI, logic = rules/repository, data = cloud database.

Discuss this question

4. What happens to a Free plan project with very low activity over 7 days?

  1. Its tables become public
  2. It is upgraded to a paid plan
  3. It is paused and can be resumed from the dashboard
  4. It is deleted immediately

Answer: C) It is paused and can be resumed from the dashboard

Explanation: Free projects are paused after low activity; press Resume project.

Discuss this question

5. Supabase is best described as:

  1. A NoSQL document database from Google
  2. An open-source Backend-as-a-Service built on PostgreSQL
  3. An Android UI toolkit
  4. A paid mobile emulator

Answer: B) An open-source Backend-as-a-Service built on PostgreSQL

Explanation: Supabase bundles a Postgres database, auth, an auto REST API, storage and more.

Discuss this question

6. Which endpoint signs a user in with email and password?

  1. POST /auth/v1/token?granttype=password
  2. POST /auth/v1/logout
  3. GET /auth/v1/password
  4. GET /rest/v1/users

Answer: A) POST /auth/v1/token?granttype=password

Explanation: The token endpoint with granttype=password returns a session.

Discuss this question

7. Which header carries the publishable key?

  1. apikey
  2. Content-Type
  3. Authorization: Bearer
  4. Prefer

Answer: A) apikey

Explanation: Publishable and secret keys go in the apikey header.

Discuss this question

8. Which header carries a signed-in user's access token?

  1. Authorization: Bearer <token
  2. Accept
  3. apikey
  4. User-Agent

Answer: A) Authorization: Bearer <token

Explanation: The user JWT goes in the Authorization header.

Discuss this question

9. check (rating between 1 and 5) on a column means:

  1. Only admins can rate
  2. The database rejects ratings outside 1–5
  3. Ratings are rounded
  4. The app UI shows a slider

Answer: B) The database rejects ratings outside 1–5

Explanation: A CHECK constraint validates data in the database.

Discuss this question

10. An insert fails with "new row violates row-level security policy". The cause is:

  1. The internet is off
  2. The table has too many columns
  3. Gson is missing
  4. No policy allows that insert for this user

Answer: D) No policy allows that insert for this user

Explanation: RLS rejected the row (error 42501).

Discuss this question

11. Which Supabase feature pushes database changes to connected apps live?

  1. Realtime
  2. Auth
  3. SQL Editor
  4. Storage

Answer: A) Realtime

Explanation: Realtime broadcasts inserts/updates/deletes over websockets.

Discuss this question

12. The "with check" part of a policy controls:

  1. The column data types
  2. The API rate limit
  3. Which new or changed rows are allowed
  4. Which rows are visible to select

Answer: C) Which new or changed rows are allowed

Explanation: using = existing rows; with check = rows being written.

Discuss this question

13. Why must the secret key never be put in an app?

  1. It only works on iOS
  2. It bypasses Row Level Security
  3. It expires every minute
  4. It slows the app down

Answer: B) It bypasses Row Level Security

Explanation: Anyone extracting it from the APK would have full access.

Discuss this question

14. Which Supabase component automatically turns tables into a REST API?

  1. Edge Functions
  2. Storage
  3. PostgREST (Data API)
  4. Realtime

Answer: C) PostgREST (Data API)

Explanation: PostgREST generates /rest/v1/<table endpoints.

Discuss this question

15. Which default gives a table hard-to-guess primary keys?

  1. int default 1
  2. boolean default true
  3. uuid default genrandomuuid()
  4. text default 'id'

Answer: C) uuid default genrandomuuid()

Explanation: genrandomuuid() creates random UUIDs.

Discuss this question

16. Which database engine does every Supabase project use?

  1. Firestore
  2. PostgreSQL
  3. SQLite
  4. MongoDB

Answer: B) PostgreSQL

Explanation: Each project is a full PostgreSQL database.

Discuss this question

17. Why do we add the apikey header in an OkHttp interceptor?

  1. Because Retrofit cannot send headers
  2. To speed up JSON parsing
  3. To encrypt the database
  4. So every Retrofit request gets it automatically

Answer: D) So every Retrofit request gets it automatically

Explanation: An interceptor modifies all outgoing requests in one place.

Discuss this question

18. When the access token expires, the app should:

  1. Disable RLS
  2. Switch to the secret key
  3. Use the refresh token to get a new access token
  4. Ask the user to reinstall the app

Answer: C) Use the refresh token to get a new access token

Explanation: POST /auth/v1/token?granttype=refreshtoken.

Discuss this question

19. In a policy, auth.uid() returns:

  1. The table's primary key
  2. The publishable key
  3. The project URL
  4. The id of the signed-in user making the request

Answer: D) The id of the signed-in user making the request

Explanation: auth.uid() reads the user id from the JWT.

Discuss this question

20. After "enable row level security" and before adding policies, API users can:

  1. Do everything on that table
  2. Only delete rows
  3. Do nothing on that table
  4. Only insert rows

Answer: C) Do nothing on that table

Explanation: RLS denies by default until a policy allows an action.

Discuss this question

21. Which column type stores an event start time with time zone?

  1. int
  2. text
  3. boolean
  4. timestamptz

Answer: D) timestamptz

Explanation: timestamptz stores an instant; clients convert to local time.

Discuss this question

22. Row Level Security (RLS) decides:

  1. How fast queries run
  2. The colour of rows in the Table Editor
  3. Which rows each user may read or change
  4. The number of columns

Answer: C) Which rows each user may read or change

Explanation: RLS policies are evaluated per row.

Discuss this question

23. With "Confirm email" turned ON, a new sign-up:

  1. Is deleted after an hour
  2. Gets no session until the user clicks the email link
  3. Becomes an admin
  4. Is signed in immediately

Answer: B) Gets no session until the user clicks the email link

Explanation: Confirmation is required before sign-in works.

Discuss this question

24. Which policy lets users add events only as themselves?

  1. for delete to anon using (true)
  2. for insert to anon with check (true)
  3. for insert to authenticated with check (auth.uid() = userid)
  4. for select using (true)

Answer: C) for insert to authenticated with check (auth.uid() = userid)

Explanation: with check compares the new row's userid to the caller.

Discuss this question

25. Which request returns only Sports events?

  1. GET /rest/v1/events?category=eq.Sports
  2. GET /rest/v1/events/Sports
  3. POST /rest/v1/events?Sports
  4. DELETE /rest/v1/events?category=Sports

Answer: A) GET /rest/v1/events?category=eq.Sports

Explanation: PostgREST filters use column=operator.value.

Discuss this question

Page 1 of 2 Next

Practise Supabase: Cloud Data Tier for Android MCQs

More Computer Science chapters