Skip to content

Instantly share code, notes, and snippets.

View llRizvanll's full-sized avatar
:octocat:
Exploring Opportunities

Rizvan Hawaldar llRizvanll

:octocat:
Exploring Opportunities
View GitHub Profile

Android Interview Questions

Q1: Explain activity lifecycle ☆☆

Answer: As a user navigates through, out of, and back to your app, the Activity instances in your app transition through different states in their lifecycle.

To navigate transitions between stages of the activity lifecycle, the Activity class provides a core set of six callbacks: onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy(). The system invokes each of these callbacks as an activity enters a new state.

JavaScript Interview Questions

Q1: Explain equality in JavaScript ☆

Answer: JavaScript has both strict and type–converting comparisons:

  • Strict comparison (e.g., ===) checks for value equality without allowing coercion
  • Abstract comparison (e.g. ==) checks for value equality with coercion allowed
@llRizvanll
llRizvanll / University.kt
Created September 22, 2023 17:06
Codility test to get getPaidCoursesWithTheNumbersOfSubscribedStudents list
package com.codility
class University(private val repository: Repository<Student>) {
fun getPaidCoursesWithTheNumbersOfSubscribedStudents(coursesCount: Int): Map<Course, Int> {
val studentList = repository.get().toList();
val courseCountMap = mutableMapOf<Course,Int>();
studentList.forEach {
student ->
student.subscribedCourses

Interview Questions

Kotlin

Q1: What is a primary constructor in Kotlin? ☆☆

Answer: The primary constructor is part of the class header. Unlike Java, you don't need to declare a constructor in the body of the class. Here's an example:

@llRizvanll
llRizvanll / HammerScript.py
Created November 18, 2020 13:43
fetch all directory files, read json and process data with nan, zero values and update the excel file with proper tags.
# import xlsxwriter module
import xlsxwriter
import json
import pandas as pd
from pathlib import Path
# using datetime module
import datetime;
#directory of all tag files with json data
@llRizvanll
llRizvanll / react-native-location.js
Last active November 15, 2020 08:55
React Native Geo Location Feature Implementation.
import React, { Component } from 'react';
import { StyleSheet,TouchableOpacity, Text, TextInput, View, SafeAreaView,Alert } from 'react-native';
import Geolocation from '@react-native-community/geolocation';
class Location extends Component {
state = {
latitude:'',
longitude:'',
errorMsg:'Unable to read location, please try again later!',
readyToLaunch:false
Given a paragraph and a list of banned words, return the most frequent word that is not in the list of banned words. It is guaranteed there is at least one word that isn't banned, and that the answer is unique.
Words in the list of banned words are given in lowercase, and free of punctuation. Words in the paragraph are not case sensitive. The answer is in lowercase.
Example:
Input:
paragraph = "Bob hit a ball, the hit BALL flew far after it was hit."
@llRizvanll
llRizvanll / CountDistinceElements.java
Last active May 17, 2019 17:11
Count distinct elements in an array
import java.util.*;
import java.lang.*;
import java.io.*;
class Viznar
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
int[] arr = {1,1,2,4,5,3,2,1,2};
/*package whatever //do not write package name here */
import java.util.*;
import java.lang.*;
import java.io.*;
class GFG {
public static void main (String[] args) {
//code
@llRizvanll
llRizvanll / App level gradle file
Last active July 5, 2017 04:13
Gradle variable declarations. Config Build path settings.
apply plugin: 'com.android.application'
def config = rootProject.ext.configuration;
def lib = rootProject.ext.libraries;
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 25