General dump - Imtiaz211/interviews GitHub Wiki

Skip Xcode plugin

Skip is very new and currently only supports iOS 16 and above

As you build your Swift and SwiftUI app in Xcode, the Skip Xcode plugin continuously transpiles it into the equivalent Kotlin and Jetpack Compose for Android. Develop dual-platform libraries or entire apps, with native performance and native user interfaces on both platforms.

Create project by running below cmd in terminal

Skip init --appid=bundle.id project-name AppName

simply install Skip, check Skip, and create the project to run on both Android and iOS.

  • For development iOS and Android in Xcode.
    • Genuinely Native
    • Totally Transparent
    • FeatherWeight
    • Memory Efficient
    • An Ideallic IDE
    • Perfect Integration
    • Foundationally Open
    • CI Friendly
    • Ejectable.
      • brew install skiptools/skip/skip "Install Skip"
      • skip checkup "Verify Installation"
      • skip checkup --verbose "Troubleshooting"

Big O Notation

Big O Notation is a way to represent how long an algorithm will take to execute. Constant time – O (1) Constant time algorithms will always take same amount of time to be executed. var arr = [ 1,2,3,4,5]; arr[2]; // => 3 Other examples include: push() and pop() operations on an array.

Linear time – O (n)

An algorithm has a linear time complexity if the time to execute the algorithm is directly proportional to the input size n. var arr2 = [apple, htc,samsung, sony, motorola]; //=> 5 steps"

Logarithmic time – O (log n)

Quadratic time – O (n^2)

Cubic time – O (n^3)

Set a target launch duration or App Launch Time

  1. Write a test to create consistent monitoring and prevent regressions.
  2. Removing 3rd party dependency could also be an option.
  3. Some frameworks can be replaced by system libraries which will result in better app launch performance.
  4. Stop converting unnecessary objects to AnyHashable.
  5. Changing String(describing:) to ObjectIdentifier().
  6. Use autorelease pools.
  7. Use weak references to avoid memory leaks.
  8. Use caching.
  9. Minimize the number of network requests.

XCTApplicationLaunchMetric import XCTest

final class AppLaunchTimeTests: XCTestCase {

/// Measure warm launch over 5 iterations (after one throw-away launch) func testLaunchPerformance() throws { // This measures how long it takes to launch your application. measure(metrics: [XCTApplicationLaunchMetric(waitUntilResponsive: true)]) { XCUIApplication().launch() } } }

UI logic and business logic what is the difference, you ask?

Business logic is the programming that manages communication between an end user interface and databases.

What is semaphore

Semaphores give us the ability to control access to a shared resource by multiple threads. A semaphore consists of a threads queue and a counter value (type Int).

[!IMPORTANT] Socket.IO is a JavaScript library for real-time web applications(Instant messengers, Push Notifications, Online Gaming). providing a bi-directional communication channel between a client and a server. The socket communication relies on the client-server logic, where a persistent connection between a server and a client always exists.