Docsity

Certified Twitter Apps Developer Practice Exam, Exams of Technology

Toggle sidebar
bg1
Certified Twitter Apps Developer Practice
Exam
**Question 1. Which OAuth 2.0 flow is recommended for a native mobile app that cannot
securely store a client secret?**
A) Authorization Code Grant with client secret
B) Implicit Grant
C) Client Credentials Grant
D) Authorization Code Grant with PKCE
Answer: D
Explanation: PKCE (Proof Key for Code Exchange) augments the standard Authorization Code
flow, allowing public clients (e.g., mobile apps) to exchange a code without a client secret,
mitigating interception attacks.
**Question 2. In Twitter API v2, which endpoint provides a full‑archive search of public
tweets?**
A) /2/tweets/search/recent
B) /2/tweets/search/all
C) /2/tweets/search/30day
D) /2/tweets/search/stream
Answer: B
Explanation: The `/2/tweets/search/all` endpoint grants access to the entire historical archive
(subject to elevated access), whereas `/recent` only returns the last seven days.
**Question 3. When configuring a Twitter App, which permission must be enabled to allow the
app to send Direct Messages on behalf of a user?**
A) Read
B) Write
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Certified Twitter Apps Developer Practice Exam and more Exams Technology in PDF only on Docsity!

Exam

Question 1. Which OAuth 2.0 flow is recommended for a native mobile app that cannot securely store a client secret? A) Authorization Code Grant with client secret B) Implicit Grant C) Client Credentials Grant D) Authorization Code Grant with PKCE Answer: D Explanation: PKCE (Proof Key for Code Exchange) augments the standard Authorization Code flow, allowing public clients (e.g., mobile apps) to exchange a code without a client secret, mitigating interception attacks. Question 2. In Twitter API v2, which endpoint provides a full‑archive search of public tweets? A) /2/tweets/search/recent B) /2/tweets/search/all C) /2/tweets/search/30day D) /2/tweets/search/stream Answer: B Explanation: The /2/tweets/search/all endpoint grants access to the entire historical archive (subject to elevated access), whereas /recent only returns the last seven days. Question 3. When configuring a Twitter App, which permission must be enabled to allow the app to send Direct Messages on behalf of a user? A) Read B) Write

Exam

C) Direct Message D) Manage Account Answer: C Explanation: The “Direct Message” permission specifically grants the ability to read and write DMs; “Write” alone only covers tweet creation, likes, and follows. Question 4. Which HTTP status code indicates that a request was rejected because the client has exceeded the rate limit for the endpoint? A) 400 Bad Request B) 401 Unauthorized C) 429 Too Many Requests D) 503 Service Unavailable Answer: C Explanation: 429 signals that the client must wait until the limit resets, as indicated by the x- rate-limit-reset header. Question 5. In a Tweet object, which field contains the unique identifier of the author of the tweet? A) id B) author_id C) user_id D) created_at Answer: B

Exam

A) #AI place_country:US B) #AI lang:en location:US C) #AI place_country:US lang:en D) #AI country:US Answer: C Explanation: Stream rules combine operators; place_country:US restricts the tweet’s place to the United States, while lang:en ensures English language. Question 9. Which header provides the number of remaining requests for the current rate‑limit window? A) X-Rate-Limit-Limit B) X-Rate-Limit-Remaining C) X-Rate-Limit-Reset D) X-Rate-Limit-Used Answer: B Explanation: X-Rate-Limit-Remaining tells you how many more calls you can make before hitting the limit. Question 10. Which endpoint allows you to upload media (images, GIFs, videos) for later attachment to a tweet? A) /2/media/upload B) /1.1/media/upload.json C) /2/tweets/media/create D) /1.1/statuses/media.json

Exam

Answer: B Explanation: The legacy /1.1/media/upload.json endpoint handles chunked media uploads required for images, GIFs, and videos. Question 11. To retrieve a user’s followers count without fetching the full User object, which query parameter should be used? A) user.fields=public_metrics B) expansions=followers_count C) tweet.fields=author_id D) media.fields=followers Answer: A Explanation: public_metrics includes follower, following, tweet, and listed counts, allowing you to pull just those numbers. Question 12. Which of the following best describes the purpose of the Compliance Stream? A) Deliver real‑time analytics about tweet engagement B) Notify apps when tweets are deleted, withheld, or labeled C) Provide a sampled random set of public tweets D) Stream live audio from Spaces Answer: B Explanation: The Compliance Stream sends events about content removal or labeling so developers can keep their stored data in sync with Twitter policies.

Exam

C) POST /2/users/:id/lists D) POST /1.1/lists/ownerships.json Answer: B Explanation: The legacy v1.1 endpoint /1.1/lists/create.json creates a List; v2 currently lacks List creation support. Question 16. Which error code indicates that the request’s OAuth token is malformed or missing? A) 400 Bad Request B) 401 Unauthorized C) 403 Forbidden D) 404 Not Found Answer: B Explanation: 401 is returned when authentication fails, including missing or invalid Bearer tokens. Question 17. Which parameter must be included when requesting a tweet’s referenced media objects? A) expansions=media_keys B) media.fields=media_key C) tweet.fields=attachments D) expansions=attachments.media_keys Answer: D

Exam

Explanation: expansions=attachments.media_keys expands the tweet’s attachments object to include full media objects. Question 18. For a server‑to‑server application that never acts on behalf of a user, which authentication method is appropriate? A) OAuth 2.0 Authorization Code with PKCE B) OAuth 2.0 Implicit Grant C) OAuth 2.0 Client Credentials D) OAuth 1.0a User Context Answer: C Explanation: The Client Credentials grant provides an app‑only Bearer token suitable for non‑user contexts. Question 19. When posting a tweet that quotes another tweet, which field must contain the quoted tweet’s ID? A) quoted_tweet_id B) quote_tweet_id C) quote_tweet_id (in the JSON body) D) quoted_status_id Answer: C Explanation: In the v2 POST /2/tweets request, you include "quote_tweet_id": "<id>" within the JSON payload. Question 20. Which header should you inspect to determine when a rate‑limit window will reset?

Exam

Answer: D Explanation: follower_count is a User metric, not a Tweet field; it belongs in user.fields. Question 23. When handling streaming data, which type of message indicates that the connection will be closed due to a rule limit being exceeded? A) Tweet payload B) Disconnection notice with code 4200 C) Keep‑alive newline D) Warning message with code 401 Answer: B Explanation: The streaming API sends a disconnection notice (e.g., code 4200) when rule limits or other quotas are breached. Question 24. To retrieve a Space’s participant count, which field must be requested? A) participant_count B) subscriber_count C) audience_size D) participant_ids Answer: A Explanation: participant_count is the dedicated metric returned when space.fields includes it. Question 25. Which endpoint allows you to mute a user on behalf of the authenticating user?

Exam

A) POST /2/users/:id/muting B) POST /1.1/mutes/users/create.json C) POST /2/users/:source_user_id/muting/:target_user_id D) POST /1.1/blocks/create.json Answer: B Explanation: The legacy v1.1 endpoint /1.1/mutes/users/create.json mutes a target user for the authenticating account. Question 26. What is the purpose of the expansions query parameter? A) To increase the number of tweets returned per request B) To retrieve related objects (e.g., users, media) referenced by IDs in the primary response C) To filter tweets by language D) To paginate through results Answer: B Explanation: expansions tells the API to replace ID references with full objects, reducing the need for additional calls. Question 27. Which HTTP method is used to delete a tweet created by the authenticated user? A) DELETE B) POST with a “delete” action parameter C) PUT D) PATCH

Exam

B) GET /1.1/lists/members.json C) GET /2/users/:id/list_memberships D) GET /1.1/lists/ownerships.json Answer: B Explanation: The v1.1 endpoint /1.1/lists/members.json returns members of a List; v2 does not yet support List member retrieval. Question 31. When using the filtered stream, how can you delete a rule that is no longer needed? A) POST /2/streams/rules/delete with rule ID B) DELETE /2/streams/rules/:id C) POST /2/tweets/search/stream/rules with “delete” action D) PUT /2/streams/rules/:id Answer: C Explanation: The endpoint POST /2/tweets/search/stream/rules accepts a JSON payload containing a delete array of rule IDs. Question 32. Which field in the User object indicates whether the account is protected (tweets visible only to approved followers)? A) verified B) protected C) private D) restricted

Exam

Answer: B Explanation: The protected boolean denotes that the user’s tweets are not publicly visible. Question 33. Which of the following is a valid use case for the Sampled Stream endpoint? A) Monitoring all tweets containing a specific brand hashtag in real time B) Collecting a random 1% of all public tweets for statistical analysis C) Fetching the full archive of tweets from a single user D) Retrieving a user’s home timeline Answer: B Explanation: The Sampled Stream provides a random subset of public tweets, useful for broad analytics. Question 34. To ensure that your app does not store deleted tweets, which real‑time feed should you subscribe to? A) Filtered Stream B) Sampled Stream C) Compliance Stream D) User Stream Answer: C Explanation: The Compliance Stream sends deletion and withholding events, allowing apps to purge or flag stored content. Question 35. Which parameter should you include to limit a search query to tweets written in Japanese?

Exam

Answer: B Explanation: The Accept header tells the server the desired response format; application/json is standard for Twitter API responses. Question 38. Which permission scope is required to read a user’s Direct Message conversations? A) read B) dm.read C) dm.write D) direct_message_read Answer: B Explanation: The dm.read scope (or equivalent “Direct Message” permission) grants read access to DM events. Question 39. Which of the following best describes the difference between tweet.fields=public_metrics and user.fields=public_metrics? A) Both return the same metrics for tweets and users B) The former returns retweet, reply, like, and quote counts for a tweet; the latter returns follower, following, tweet, and listed counts for a user C) tweet.fields does not support public_metrics D) user.fields does not support public_metrics Answer: B Explanation: Tweet public_metrics cover engagement on that tweet; User public_metrics cover overall account statistics.

Exam

Question 40. When building a caching layer for tweet lookups, which identifier should you use as the cache key to guarantee uniqueness? A) tweet text B) tweet ID C) author ID + created_at D) tweet URL Answer: B Explanation: The tweet’s id is a globally unique 64‑bit identifier, ideal for cache keys. Question 41. Which endpoint allows you to retrieve the list of Spaces a user is currently speaking in? A) GET /2/spaces/by/creator_id/:id B) GET /2/users/:id/spaces C) GET /2/spaces/:id/participants D) GET /2/spaces/search Answer: B Explanation: /2/users/:id/spaces returns Spaces the user is hosting, speaking in, or invited to. Question 42. What does the tweet_mode=extended query parameter do in the legacy v1. API? A) Enables real‑time streaming B) Returns the full text of tweets longer than 140 characters C) Adds extra fields like public_metrics D) Switches the endpoint to use OAuth 2.

Exam

A) POST /1.1/lists/members/create.json B) POST /2/lists/:id/members C) POST /1.1/lists/create.json D) POST /2/users/:id/list_memberships Answer: A Explanation: The v1.1 endpoint /1.1/lists/members/create.json adds a user to a List. Question 46. Which of the following is a recommended practice for handling OAuth tokens in a production environment? A) Hard‑code the bearer token in source code B) Store tokens in environment variables or a secret manager C) Pass tokens as URL query parameters D) Log tokens to console for debugging Answer: B Explanation: Secure storage (env vars, secret vaults) prevents accidental exposure; hard‑coding or logging tokens is insecure. Question 47. When using the recent search endpoint, which parameter controls the earliest timestamp a tweet can have to be included in results? A) start_time B) since_id C) from_date D) earliest

Exam

Answer: A Explanation: start_time (ISO 8601) sets the lower bound for tweet creation dates. Question 48. Which error response indicates that the authenticated user does not have permission to perform the requested action? A) 400 Bad Request B) 401 Unauthorized C) 403 Forbidden D) 404 Not Found Answer: C Explanation: 403 denotes that authentication succeeded but the user lacks the required scope/permission. Question 49. In the context of the Ads API, what is a “line item”? A) A single tweet posted by an advertiser B) A budgeted advertising unit within a campaign C) A user’s timeline entry D) A rule for filtered streaming Answer: B Explanation: A line item represents an ad group with its own budget, targeting, and creative within a campaign. Question 50. Which endpoint returns the current rate‑limit status for all endpoints for the authenticated app?