Bird
Raised Fist0
Intro to Computingfundamentals~20 mins

HTTP and HTTPS protocols in Intro to Computing - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
HTTP/HTTPS Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the difference between HTTP and HTTPS

Which statement best explains the main difference between HTTP and HTTPS?

AHTTP requires a digital certificate, but HTTPS does not.
BHTTP uses port 443 by default, while HTTPS uses port 80.
CHTTPS encrypts data sent between the browser and server, while HTTP does not.
DHTTPS is slower because it sends data in plain text.
Attempts:
2 left
💡 Hint

Think about security and data protection when browsing websites.

trace
intermediate
2:00remaining
Tracing a simple HTTP request flow

Consider a user typing a website address starting with http://. Which sequence correctly shows the flow of the request?

ABrowser sends request → Browser displays page → Server responds with webpage
BBrowser sends request → Server responds with webpage → Browser displays page
CServer sends request → Browser responds with webpage → Server displays page
DServer sends request → Server displays page → Browser responds with webpage
Attempts:
2 left
💡 Hint

Who initiates the request and who responds?

identification
advanced
2:00remaining
Identifying HTTPS security features

Which feature is NOT part of HTTPS security?

AAutomatic blocking of all pop-up ads
BAuthentication of the website using certificates
CData encryption to prevent eavesdropping
DData integrity to prevent tampering
Attempts:
2 left
💡 Hint

Think about what HTTPS protects against.

Comparison
advanced
2:00remaining
Comparing ports used by HTTP and HTTPS

Which option correctly matches the default ports used by HTTP and HTTPS?

AHTTP uses port 80, HTTPS uses port 443
BHTTP uses port 443, HTTPS uses port 80
CBoth HTTP and HTTPS use port 8080
DHTTP uses port 21, HTTPS uses port 22
Attempts:
2 left
💡 Hint

Remember common web ports for secure and non-secure traffic.

🚀 Application
expert
2:00remaining
Determining the result of mixed content on a webpage

A webpage is loaded over HTTPS but includes an image loaded over HTTP. What is the likely outcome in modern browsers?

AThe browser automatically converts the HTTP image to HTTPS.
BThe entire webpage fails to load.
CThe HTTP image loads without any warnings or blocks.
DThe browser blocks the HTTP image to keep the page secure.
Attempts:
2 left
💡 Hint

Think about how browsers handle mixed secure and non-secure content.

Practice

(1/5)
1. What is the main difference between HTTP and HTTPS?
easy
A. HTTPS encrypts data while HTTP does not
B. HTTP encrypts data while HTTPS does not
C. HTTP is faster because it uses encryption
D. HTTPS is only used for email communication

Solution

  1. Step 1: Understand HTTP basics

    HTTP is a protocol used for communication between browsers and websites without encryption.
  2. Step 2: Understand HTTPS security

    HTTPS adds encryption to protect data during transmission, making it secure.
  3. Final Answer:

    HTTPS encrypts data while HTTP does not -> Option A
  4. Quick Check:

    Encryption = HTTPS [OK]
Hint: HTTPS means secure, HTTP does not [OK]
Common Mistakes:
  • Confusing which protocol encrypts data
  • Thinking HTTP is secure by default
  • Believing HTTPS is only for emails
2. Which of the following is the correct way to write a URL using HTTPS?
easy
A. http://www.example.com
B. htpps://www.example.com
C. htp://www.example.com
D. https://www.example.com

Solution

  1. Step 1: Identify correct HTTPS syntax

    The correct prefix for secure websites is https:// with 'https' fully spelled and followed by '://'.
  2. Step 2: Check each option

    https://www.example.com matches the correct syntax exactly; others have typos or use HTTP.
  3. Final Answer:

    https://www.example.com -> Option D
  4. Quick Check:

    Correct HTTPS URL = https://www.example.com [OK]
Hint: HTTPS URLs start with 'https://' exactly [OK]
Common Mistakes:
  • Typing 'htp' or 'htpps' instead of 'https'
  • Using 'http' instead of 'https' for secure sites
  • Missing the '://' after the protocol
3. Consider this simplified flowchart of a browser requesting a webpage:



If the protocol is HTTPS, what extra step happens during the 'Browser sends request' phase?
medium
A. The browser encrypts the request before sending
B. The browser sends the request without encryption
C. The browser skips sending the request
D. The browser sends the request twice

Solution

  1. Step 1: Analyze HTTPS request process

    HTTPS requires encrypting data before sending it to protect privacy.
  2. Step 2: Compare options with HTTPS behavior

    Only The browser encrypts the request before sending describes encryption before sending, which matches HTTPS protocol.
  3. Final Answer:

    The browser encrypts the request before sending -> Option A
  4. Quick Check:

    Encryption before sending = The browser encrypts the request before sending [OK]
Hint: HTTPS encrypts data before sending [OK]
Common Mistakes:
  • Thinking HTTPS sends data unencrypted
  • Assuming browser sends request twice
  • Believing browser skips sending request
4. A developer wrote this code snippet to fetch a webpage securely:
fetch('http://secure-site.com/data')

What is the main problem here?
medium
A. The URL is missing a domain extension
B. The fetch function is misspelled
C. The URL uses HTTP instead of HTTPS
D. The code is missing a semicolon

Solution

  1. Step 1: Check URL protocol

    The URL uses http:// which is not secure for sensitive data.
  2. Step 2: Identify correct secure protocol

    To fetch data securely, the URL should start with https://.
  3. Final Answer:

    The URL uses HTTP instead of HTTPS -> Option C
  4. Quick Check:

    Secure fetch needs HTTPS URL [OK]
Hint: Secure fetch requires HTTPS URL [OK]
Common Mistakes:
  • Ignoring the protocol difference
  • Thinking semicolon is mandatory in JavaScript fetch
  • Assuming fetch is misspelled
5. You want to ensure a website always uses HTTPS even if a user types HTTP. Which method should you use?
hard
A. Disable HTTP protocol on the user's browser
B. Set up a redirect from HTTP to HTTPS on the server
C. Use HTTP for all pages and HTTPS only for login
D. Ask users to manually type HTTPS every time

Solution

  1. Step 1: Understand how to enforce HTTPS

    Redirecting HTTP requests to HTTPS ensures all traffic is secure automatically.
  2. Step 2: Evaluate other options

    Disabling HTTP on user browsers or manual typing is impractical; partial HTTPS use is insecure.
  3. Final Answer:

    Set up a redirect from HTTP to HTTPS on the server -> Option B
  4. Quick Check:

    Redirect HTTP to HTTPS = Set up a redirect from HTTP to HTTPS on the server [OK]
Hint: Use server redirect to force HTTPS [OK]
Common Mistakes:
  • Thinking users must type HTTPS manually
  • Believing disabling HTTP on browsers is feasible
  • Using HTTP for some pages weakens security