• InstaByte
  • Posts
  • OpenAI launches AI Coding agent

OpenAI launches AI Coding agent

ALSO: OAuth vs JWT for Authentication

Welcome back!

Most people have already solved the 'Two Sum problem'. This week, we will solve a slightly harder variation of the 'Two Sum problem'. Let's see if you can solve it by yourself.

Today we will cover:

  • Two Sum II - Input Array Is Sorted

  • OAuth vs JWT for Authentication

Read time: under 4 minutes

CODING CHALLENGE

Two Sum II - Input Array Is Sorted

Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 <= numbers.length.

Return the indices of the two numbers, index1 and index2, added by one as an integer array [index1, index2] of length 2.

The tests are generated such that there is exactly one solution. You may not use the same element twice.

Your solution must use only constant extra space.

Example 1:

Input: numbers = [2,7,11,15], target = 9
Output: [1,2]
Explanation: The sum of 2 and 7 is 9. Therefore, index1 = 1, index2 = 2. We return [1, 2].

Example 2:

Input: numbers = [2,3,4], target = 6
Output: [1,3]
Explanation: The sum of 2 and 4 is 6. Therefore index1 = 1, index2 = 3. We return [1, 3].

Example 3:

Input: numbers = [-1,0], target = -1
Output: [1,2]
Explanation: The sum of -1 and 0 is -1. Therefore index1 = 1, index2 = 2. We return [1, 2].

Solve the problem here before reading the solution.

PRESENTED BY FRONTEGG

Are You Drowning in Constant CIAM tasks?

You didn’t become a dev to debug login flows or build SSO connections. You became a dev to innovate. With Frontegg, you can skip the tickets and get back to building. Book a demo and score a relaxation kit.

SOLUTION

We can solve this problem efficiently using the two-pointer approach. Since the input array is already sorted in non-decreasing order, we can place one pointer at the beginning and another at the end of the array.

We'll move the pointers based on the sum of the elements at those indices compared to the target. If the sum is less than the target, we'll move the left pointer to the right to increase the sum. If the sum is greater than the target, we'll move the right pointer to the left to decrease the sum.

This approach allows us to find the two numbers that add up to the target while using only constant extra space.

The time complexity of this solution is O(n), where n is the length of the input array. We make a single pass through the array, and the two pointers converge towards each other.

SYSTEM DESIGN

OAuth vs JWT for Authentication

When building applications that require user authentication, developers often get confused between OAuth and JWT (JSON Web Tokens). While both are related to authentication and authorization, they serve different purposes and can even be used together.

OAuth is a protocol that enables applications to obtain limited access to user accounts on other services. When you click ""Login with Google,"" you're using OAuth. The application gets a token to access specific parts of your Google account, but not your actual Google password.

JWT, on the other hand, is a format for securely transmitting information between parties as a JSON object. This token contains user information and is digitally signed to ensure it hasn't been tampered with. When a user logs in, the server creates a JWT containing user details and permissions, which the client then uses for subsequent requests.

OAuth involves multiple parties: the user, the application (client), and the authentication server (like Google). The application redirects users to the authentication server, where they log in directly. This makes OAuth more secure for third-party authentication since the application never sees the user's credentials.

JWTs are simpler - they typically involve just the application and its users. The application handles login directly and issues JWTs. While this is fine for simple applications, it means you're responsible for securely storing and managing user credentials.

Here's what makes each option better for different scenarios:

  • Use OAuth when you want users to log in using their existing accounts from other services (like Google or Facebook)

  • Use JWTs when you're building a self-contained application and want to manage authentication yourself

Here's a comparison of OAuth and JWT:

Feature

OAuth

JWT

Purpose

Authorization protocol

Token format

Complexity

More complex

Simpler

Best For

Third-party authentication

Direct authentication

Security responsibility

Shared with auth provider

Handled by application

FEATURED COURSES

5 Courses of the Week

 Amazon’s DSA: Implement and analyze fundamental data structures and algorithms in Java, including sorting, searching, and recursive techniques with JUnit testing methodology.

 Google’s Intro to Git & GitHub: Understand version control and learn how to collaborate with others using Git and Github.

 IBM’s Python for Data Science, AI & Development: Learn Python basics, data structures, and libraries (Pandas, NumPy) for data science and automation in this beginner-friendly course. You'll gain hands-on experience with Jupyter Notebooks, performing tasks like data collection and web scraping with APIs.

 Firebase in a Weekend (Android): This course will teach you when and why to choose Firebase as a backend for your Android app.

 Microsoft’s Full-Stack Developer Certificate: Learn front-end and back-end development using .NET, C#, Blazor, and Microsoft Copilot. Build complete web apps with focus on security and deployment.

LEARN AI 

Start learning AI in 2025

Keeping up with AI is hard – we get it!

That’s why over 1M professionals read Superhuman AI to stay ahead.

  • Get daily AI news, tools, and tutorials

  • Learn new AI skills you can use at work in 3 mins a day

  • Become 10X more productive

NEWS

This Week in the Tech World

OpenAI Debuts Codex Agent: OpenAI introduced Codex, an AI agent for coding that generates production-ready code and shows its work. The tool operates in a container that reflects the developer's environment and supports custom instructions via AGENTS.md files. It's available to ChatGPT Pro, Enterprise, and Team users.

Google Demos Android XR Smart Glasses: Google showcased new smart glasses with Gemini AI, featuring real-time language translation between Farsi, Hindi, and English. Google partners with Warby Parker and Gentle Monster, competing directly with Meta's Ray-Ban glasses.

Google I/O 2025 Highlights: Google unveiled AI Search for all US users, Android XR Glasses demo, Veo 3 video generator, Gemini Live expansion, and Project Astra AI assistant advances. Major focus on AI integration across search, mobile, and extended reality platforms.

Waymo Expands in California: Alphabet's Waymo received approval to expand its autonomous ride-hailing service to more parts of the San Francisco Bay Area, including San Jose. While this won't change operations immediately, the company plans to bring Waymo One to more areas in the future.

Google Launches Veo 3 AI Video Generator: Google unveiled Veo 3, an AI video generator that incorporates audio with features like dialogue between characters and animal sounds. The tool competes with OpenAI's Sora but distinguishes itself with audio integration. It's available to Ultra subscription users at $249.99 monthly.

GitHub Introduces Coding Agent: Microsoft's GitHub launched a Copilot AI agent that can handle specific programming tasks like fixing bugs or rewriting code. The agent submits work for developer review before adding to existing files. It's powered by Anthropic's Claude 3.7 Sonnet model.

Google Enables On-Device AI for Developers: Google will give app developers access to Gemini Nano for on-device AI through ML Kit SDK. This allows apps to perform summarization, proofreading, rewriting, and image description without sending data to the cloud, improving privacy and performance on compatible devices.

Microsoft Open-Sources WSL: Microsoft has made almost all of Windows Subsystem for Linux (WSL) open source, closing a 9-year-old feature request. Only a few components remain closed-source. Microsoft expects increased community contributions to accelerate WSL's evolution and development.

BONUS

Just for laughs 😏

HELP US

👋 Hi there! We are on a mission to provide as much value as possible for free. If you want this newsletter to remain free, please help us grow by referring your friends:

📌 Share your referral link on LinkedIn or directly with your friends.
📌 Check your referrals status here.

YOUR FEEDBACK

What did you think of this week's email?

Your feedback helps us create better emails for you!

Login or Subscribe to participate in polls.

Until next time, take care! 🚀

Cheers,