apis Flashcards

1
Q

What is the difference between REST and SOAP APIs?

A
  • REST - JSON, HTTP methods, caching
  • SOAP - XML
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you handle C# API error handling?

A
  • Use Try-Catch Blocks
  • Return Appropriate HTTP Status Codes
  • 400 Bad Request
  • 500 Internal Server Error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is C# API data serialization?

A
  • Convert data into format that can be transmitted and reconstructed on receiving end
  • JSON - C# has libraries like Newtonsoft.Json for serializing and deserializing JSON data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you deal with C# API security?

A
  • Authentication - e.g. OAuth (Bearer Tokens), JWT, etc.
  • Rate Limiting - to prevent DDOS attacks
  • API Versioning - make sure code changes to APi doesn’t affect existing clients
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are C# REST principles?

A
  • Stateless Communication - each request is independent and doesn’t rely on any previous requests
  • HTTP Methods - GET, POST, PUT, DELETE
  • Representation - JSON
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an API wrapper?

A
  • API wrapper lets you call it instead of the API directly.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some API performance and optimizations?

A
  • Caching
  • Rate Limiting
  • Asynchronous Processing
  • Load Balancing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Consume API steps

A
  1. GetAsync()
  2. ReadAsStringAsync()
  3. DeserializeObject
How well did you know this?
1
Not at all
2
3
4
5
Perfectly