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? GET HEAD OPTIONS 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: servicerole anon authenticated 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: Network tier only Hardware tier Data tier 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? Its tables become public It is upgraded to a paid plan It is paused and can be resumed from the dashboard 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: A NoSQL document database from Google An open-source Backend-as-a-Service built on PostgreSQL An Android UI toolkit 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? POST /auth/v1/token?granttype=password POST /auth/v1/logout GET /auth/v1/password 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? apikey Content-Type Authorization: Bearer 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? Authorization: Bearer <token Accept apikey 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: Only admins can rate The database rejects ratings outside 1–5 Ratings are rounded 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: The internet is off The table has too many columns Gson is missing 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? Realtime Auth SQL Editor Storage Answer: A) Realtime
Explanation: Realtime broadcasts inserts/updates/deletes over websockets.
Discuss this question
12. The "with check" part of a policy controls: The column data types The API rate limit Which new or changed rows are allowed 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? It only works on iOS It bypasses Row Level Security It expires every minute 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? Edge Functions Storage PostgREST (Data API) 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? int default 1 boolean default true uuid default genrandomuuid() 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? Firestore PostgreSQL SQLite 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? Because Retrofit cannot send headers To speed up JSON parsing To encrypt the database 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: Disable RLS Switch to the secret key Use the refresh token to get a new access token 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: The table's primary key The publishable key The project URL 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: Do everything on that table Only delete rows Do nothing on that table 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? int text boolean timestamptz Answer: D) timestamptz
Explanation: timestamptz stores an instant; clients convert to local time.
Discuss this question
22. Row Level Security (RLS) decides: How fast queries run The colour of rows in the Table Editor Which rows each user may read or change 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: Is deleted after an hour Gets no session until the user clicks the email link Becomes an admin 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? for delete to anon using (true) for insert to anon with check (true) for insert to authenticated with check (auth.uid() = userid) 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? GET /rest/v1/events?category=eq.Sports GET /rest/v1/events/Sports POST /rest/v1/events?Sports 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